Skip to content

fix: beta resolver typecheck + build smoke check - #19060

Merged
Hona merged 1 commit into
anomalyco:devfrom
Hona:fix/beta-resolver-context
Mar 25, 2026
Merged

fix: beta resolver typecheck + build smoke check#19060
Hona merged 1 commit into
anomalyco:devfrom
Hona:fix/beta-resolver-context

Conversation

@Hona

@Hona Hona commented Mar 25, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 25, 2026 05:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the beta-branch merge automation script to improve conflict-resolution prompts and add an end-of-run typecheck/build smoke verification for packages/opencode.

Changes:

  • Refactors repeated PR-list formatting into a shared lines(prs) helper.
  • Enhances the conflict-resolution prompt to require a bun typecheck pass after resolving conflicts.
  • Adds a smoke() step after merging to run bun typecheck and ./script/build.ts --single, with optional auto-fix + commit if the working tree is dirty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread script/beta.ts Outdated
Comment on lines +104 to +120
"Run `bun typecheck` in `packages/opencode`.",
"Run `./script/build.ts --single` in `packages/opencode`.",
"Fix any merge-caused issues until both commands pass.",
"Do not create a commit.",
].join("\n")

try {
await $`opencode run -m opencode/gpt-5.3-codex ${prompt}`
} catch (err) {
console.log(`Smoke fix failed: ${err}`)
return false
}

try {
await $`bun typecheck`.cwd("packages/opencode")
await $`./script/build.ts --single`.cwd("packages/opencode")
} catch (err) {

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./script/build.ts --single in packages/opencode performs network fetches (models.dev) and generates/updates src/provider/models-snapshot.*. With the current git status/git add -A flow below, the smoke check can end up committing unrelated/generated snapshot changes (or new files) to the beta branch even when merges are otherwise clean. Consider making the build step deterministic for this script (e.g., pass MODELS_DEV_API_JSON/pin the snapshot), or explicitly restore/clean generated snapshot files before deciding whether to commit smoke fixes.

Copilot uses AI. Check for mistakes.
Comment thread script/beta.ts Outdated
Comment on lines +117 to +120
try {
await $`bun typecheck`.cwd("packages/opencode")
await $`./script/build.ts --single`.cwd("packages/opencode")
} catch (err) {

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.ts supports --skip-install, but the smoke check currently runs it without that flag. Because build.ts runs bun install by default, this smoke step can mutate bun.lockb/dependency state and then the later git add -A can commit those lockfile changes. If the goal is a build smoke test (not dependency updates), consider invoking ./script/build.ts --single --skip-install here.

Copilot uses AI. Check for mistakes.
Comment thread script/beta.ts
Comment on lines +131 to +132
try {
await $`git add -A`

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The smoke check auto-commits any dirty working tree via git add -A / git commit. As written, this can accidentally include files outside the intended smoke-fix scope (e.g., untracked/generated files created during the smoke commands). Consider restricting what gets staged (limit to known paths) or failing with a clear message listing git status --porcelain entries so a human can review, rather than committing everything blindly.

Suggested change
try {
await $`git add -A`
// Only allow auto-committing changes within packages/opencode.
// If there are changes elsewhere, list them and abort so a human can review.
const statusLines = out.trim().split("\n")
const unsafeChanges = statusLines.filter((line) => {
// Porcelain format: "XY path" (at least 3 chars; path may contain spaces but starts at index 3).
const path = line.length > 3 ? line.slice(3).trim() : ""
return !(path === "packages/opencode" || path.startsWith("packages/opencode/"))
})
if (unsafeChanges.length > 0) {
console.log("Smoke check produced changes outside packages/opencode; refusing to auto-commit.")
console.log("Please review and handle these changes manually:")
console.log(unsafeChanges.join("\n"))
return false
}
try {
await $`git add packages/opencode`
Copilot uses AI. Check for mistakes.
@Hona
Hona enabled auto-merge (squash) March 25, 2026 05:37
@Hona
Hona force-pushed the fix/beta-resolver-context branch from 348245a to 8b36e37 Compare March 25, 2026 05:37
@Hona
Hona merged commit 9a64bdb into anomalyco:dev Mar 25, 2026
8 checks passed
Andres77872 pushed a commit to Andres77872/opencode that referenced this pull request Mar 26, 2026
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants