Skip to content

fix: beta resolver typecheck + build smoke check#19060

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

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

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented Mar 25, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 25, 2026 05:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.

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) {
Copy link

Copilot AI Mar 25, 2026

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.
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) {
Copy link

Copilot AI Mar 25, 2026

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 on lines +131 to +132
try {
await $`git add -A`
Copy link

Copilot AI Mar 25, 2026

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants