Repository navigation
Conversation
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
✅ Applied the requested follow-up changes in commit 8bc2bdc Processed 2 comments:
Summary of ChangesI fixed the Validate Changes failure. The Core Package Lint step was failing because I moved those branches into three small helpers in the same file:
The function still produces the same Docker arguments in the same order. Checks run locally:
This is an internal refactor with nothing visible to users, so I didn't create a preview. Review digestRisk-tiered paths
Diff size: 1 file changed, +23/−8 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed the Validate Changes failure. The Core Package Lint step was failing because `buildOpenCodeDockerArgs` in `packages/core/src/agents/impl/openCodeUtils.ts` had a complexity of 27, and the limit is 20. The version checks added by the 2.4.2 upgrade pushed it over. I moved those branches into three small helpers in the same file: - **`isLegacyOpenCodeCli(config)`** checks whether the pinned CLI version is from series 1. - **`buildOpenCodePermissionFlags(legacyCli, repositoryInspection)`** returns `--auto` for 2.x. For 1.x it keeps `--pure --auto` for scout runs and `--dangerously-skip-permissions` otherwise. - **`buildOpenCodeConfigEnvArgs(legacyCli, repositoryInspection)`** returns the `OPENCODE_CONFIG_*` environment variables, including the separate config directory and the overrides that scout runs use on 2.x. The function still produces the same Docker arguments in the same order. Checks run locally: - `npm run lint` in `packages/core` passes with zero warnings, and `tsc --noEmit` reports no errors. - `test/opencodeAgent.test.ts` passed 32 of 32 and `test/reviewContextScoutRuntime.test.ts` passed 13 of 13. They need `PROPR_DEMO_MODE=true`, and the second also needs `--experimental-test-module-mocks`; without those flags they fail before running anything. This is an internal refactor with nothing visible to users, so I didn't create a preview. PR: #3820 Comment by: @propr-dev[bot] (ID: 7191350506) Comment by: @github-actions[bot] (ID: 7191350976) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
Tested this branch against the real OpenCode 2.4.2 CLI ( Bug: A data directory written by OpenCode 1.x (seen with 1.16) already has a What happens in the entrypoint:
Any installation that ran OpenCode 1.x tasks will hit this on its first 2.x task. Fix: only replace the runtime rows when the source table actually has rows. For example, return early from The rest of the upgrade passed when tested against the real 2.4.2 CLI:
The agent image build is still untested; Docker was not available here either. |
|
✅ Applied the requested follow-up changes in commit dbb7a99 Summary of ChangesI fixed the bug:
The fix is in
Both tests pass. Run against the unfixed script, the first test fails, so it does catch the bug. The existing I did not run the fix against the real OpenCode 2.4.2 CLI. Review digestRisk-tiered paths
Diff size: 2 files changed, +96/−0 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed the bug: `seed` no longer wipes the credentials of users upgrading from OpenCode 1.x. If the source database's `credential` table has no rows, `seed` now returns before touching the runtime database. The credentials OpenCode imported from `auth.json` stay in place, so the task keeps the OpenAI and OpenRouter logins. `seed` also skips creating `propr_original_credential` in that case, so the later `sync` does nothing. That matches what already happened for 1.x stores with no `credential` table at all. One consequence: if OpenCode refreshes the OpenAI token during the task, that refresh is not written to the source database. The entrypoint still copies `auth.json` and `account.json` back after the task, and `seed` stays a no-op until the source table has rows of its own. The fix is in `scripts/opencode-credentials.py`, and the tests are in a new file, `test/opencodeCredentials.test.ts`. The suite runner picks the file up automatically. It has two tests that run the real script with `python3` against throwaway SQLite databases: - **The case you reported:** a 1.x source with an empty `credential` table plus `auth.json`, and a runtime database already holding the two imported credentials. After `seed`, both runtime rows are still there. After a simulated token refresh and `sync`, the source table is still empty. - **Normal 2.x case:** when the source has credential rows, `seed` still replaces the stale runtime rows with them and records the starting values. Both tests pass. Run against the unfixed script, the first test fails, so it does catch the bug. The existing `test/opencodeAgent.test.ts` still passes (44/44) when run with `PROPR_DEMO_MODE=true`; without that setting it exits early in this container. ESLint ignores this test file, so it wasn't linted. I did not run the fix against the real OpenCode 2.4.2 CLI. PR: #3820 Comment by: @integry (ID: 7204570682) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
Retested One remaining problem: on installs upgraded from 1.x, refreshed OAuth credentials are thrown away after every run. In the empty-table case, The result: any OAuth refresh that happens during a task lives only in the disposable database and is lost. The host keeps the original refresh token for good. If the provider rotates refresh tokens on use, the next task's refresh would fail and that login would stop working. I believe OpenAI's ChatGPT sign-in does rotate them, but please confirm. API-key credentials (e.g. OpenRouter) are not affected. Suggested fix:
Tests to add:
|
|
✅ Applied the requested follow-up changes in commit b39c0b8 Summary of ChangesI fixed it: on installs upgraded from 1.x, OAuth refreshes made during a run now reach the host database instead of being thrown away. How it works now (
Two places where I went beyond your suggestion
Tests
I added one sentence to Does ChatGPT sign-in rotate refresh tokens? Very likely yes, but I couldn't find an official OpenAI statement. A write-up of running Codex in CI reports Sources:
Review digestRisk-tiered paths
Diff size: 3 files changed, +95/−27 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed it: on installs upgraded from 1.x, OAuth refreshes made during a run now reach the host database instead of being thrown away. `test/opencodeCredentials.test.ts` passes (3/3). I haven't rerun this against the real OpenCode 2.4.2 CLI; the tests use hand-built SQLite databases. **How it works now (`scripts/opencode-credentials.py`)** - **`seed`:** it always creates `propr_original_credential`, with an extra `on_host` column. If the host table has rows, they replace the runtime rows as before (`on_host = 1`). If the host table is empty, the rows OpenCode imported from `auth.json` are kept and recorded with `on_host = 0`. - **`sync`, host rows:** unchanged. A refresh is written only if the host still holds the value the run started with. - **`sync`, imported rows:** each one is inserted into the host database only if the host still has no row with that `id`. After the first run the host database holds the credentials, so later runs take the normal path. - **`auth.json`:** never written, so a pinned 1.x CLI keeps working. **Two places where I went beyond your suggestion** 1. **I copy every imported row, not just the changed ones.** Once the host table has any rows, the next `seed` treats it as the full set. If only the refreshed OpenAI row were written back, the next run would replace the runtime rows with that one row and drop the OpenRouter key. 2. **An imported row is also skipped if the host already has a credential for the same integration.** A login made on the host during the run gets its own `id`, so checking `id` alone would add a second OpenAI credential next to it. One side effect: if you deliberately keep two credentials for one integration and the host gains one mid-run, the imported one isn't copied. **Tests** - 1.x store, then a refresh during the run: afterwards the host database has the refreshed OpenAI row and the unchanged OpenRouter row, and `auth.json` is byte-for-byte the same. The next `seed` loads both from the host and ignores a stale re-import from `auth.json`. - Rows added on the host during the run, one with the same `id` and one for the same integration: neither is overwritten. - I ran the migration test against the previous script and it fails there, as it should. The concurrent-row test checks that nothing is overwritten, which the old script also satisfied, so it passes on both. - The existing OpenCode 2 seed test now also checks `on_host`. I added one sentence to `docs/docs/architecture/agent-runtime.md` describing the one-time move and that `auth.json` stays untouched. **Does ChatGPT sign-in rotate refresh tokens?** Very likely yes, but I couldn't find an official OpenAI statement. A write-up of running Codex in CI reports `refresh_token_reused` errors after an old refresh token was reused. Code comments in open-source Codex auth clients also say every refresh issues a new refresh token that must be saved. So your concern is valid. Sources: - [Classmethod: running Codex in CI with Plus/Pro auth.json](https://dev.classmethod.jp/articles/codex-cli-plus-pro-auth-json-ci/) - [git-ca token.rs (rotation comment)](https://docs.rs/crate/git-ca/0.2.3/source/src/auth/codex/token.rs) - [OpenAI Codex CI/CD auth docs](https://developers.openai.com/codex/auth/ci-cd-auth) PR: #3820 Comment by: @integry (ID: 7205808941) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
Tested the built agent image ( Bug: every OpenCode run with a host Cause: The earlier host-level tests ran every step as one user, so they couldn't catch this. Fix I verified: run the probe as node, the same way as the commands after it: - if [ -n "$opencode_source_data" ] && [ -f "$source_db" ] && [[ "$(opencode --version)" == "opencode v2."* ]]; then
+ if [ -n "$opencode_source_data" ] && [ -f "$source_db" ] && [[ "$(su-exec node env HOME=/home/node opencode --version)" == "opencode v2."* ]]; thenWith only that line changed, the same real task passed end to end:
Please also add a regression check that runs the entrypoint as root (as ProPR does with |
|
✅ Applied the requested follow-up changes in commit ca1ab61 Summary of ChangesI made your one-line fix and added the regression check you asked for. I couldn't run the new Docker check here: there's no Docker, and I can't become root, so the ownership bug itself can't be reproduced in this container. It will first run when Fix ( Regression check ( Unit guard ( What I ran:
Things to keep in mind:
Review digestRisk-tiered paths
Diff size: 3 files changed, +40/−1 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I made your one-line fix and added the regression check you asked for. I couldn't run the new Docker check here: there's no Docker, and I can't become root, so the ownership bug itself can't be reproduced in this container. It will first run when `scripts/smoke-test-images.sh` runs in CI. **Fix** (`scripts/opencode-entrypoint.sh:84`): the version probe now runs as `su-exec node env HOME=/home/node opencode --version`, like the commands after it. I added a comment explaining that OpenCode creates `log/` even for `--version`. **Regression check** (`scripts/smoke-test-images.sh`, after the `gh` wrapper check): it starts the agent image the way ProPR does, with `--user 0:0` and the same disposable-state environment variables. It also creates a host data dir containing an empty `opencode.db`, so the probe, `auth list --standalone`, `seed` and `sync` steps all run. The command handed to the entrypoint first checks that it is running as UID 1000. It then lists anything under `/tmp/propr-opencode-data` not owned by node. The smoke fails if the entrypoint exits non-zero or that list isn't empty, and prints the entrypoint's log in either case. On the old line it would have listed the root-owned `log/opencode.log`. **Unit guard** (`test/opencodeAgent.test.ts`): a new test checks that every `opencode` call in the entrypoint goes through `su-exec node env HOME=/home/node`. This catches the problem without Docker. **What I ran:** - `test/opencodeAgent.test.ts`: 45 pass, 0 fail. - Against the entrypoint from `HEAD`, the new test picks out exactly the old root probe line. - `bash -n` passes on both scripts. - `seed` and `sync` run cleanly against an empty source database. **Things to keep in mind:** - The new check doesn't use `--network none`, unlike the other checks there. I couldn't confirm that `opencode auth list --standalone` 2.4.2 works offline, so I matched your test setup instead. - The new check doesn't cover the task run itself: if a node-run step leaves something root-owned, it won't show up. In practice only the root-run steps (the chown and the probe) can do that. PR: #3820 Comment by: @integry (ID: 7215458472) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR upgrades OpenCode to 2.4.2 and adapts packaging, invocation, scout configuration, and credential persistence. It needs a localized correction before merge: legacy credentials still lose refreshes when the mounted source has no database or credential table. ✅ Ownership correction — The entrypoint now probes OpenCode as ✅ Guarded credential updates — Existing database credentials are updated only when their host value still matches the seeded value, preserving intervening host changes. ✅ Complete packaging integration — The credential helper is included in the agent image, production build context, and both bundle-content hash lists. Current-head checks report 31 passed and no failures. This review uses static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Persist refreshes for JSON-only stores
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise existing-row synchronizationThe new credential tests verify migration and seeding, but do not exercise the ScoreThe upgrade is cohesive and current checks pass, but a supported legacy credential path still discards refreshes. A localized persistence fix is needed before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
I checked F1 from the review against real installs. It's real but narrow, and the review's "minimum fix" shouldn't be taken literally. How often this happens: OpenCode 1.19.6 (the current pin) creates Please don't create a database or Suggested approach: when the host has no usable credential table, Please add regression tests for both shapes: a host with only |
I rebuilt the credential handling so the host's own credential table decides which store is authoritative, as you asked. The `opencodeCredentials` tests (16) and `opencodeAgent` tests (45) all pass, but I haven't re-run your built-image reproduction. **How it works now (`scripts/opencode-credentials.py`)** - **1.x host (no `credential` table, or an empty one):** `auth.json` is the host store. - `seed` keeps the rows OpenCode imported from `auth.json` and now saves a copy of `auth.json` in the empty-table case too. - `sync` only writes refreshes back through `sync_auth_json`, which keeps its check that the host entry still matches what was seeded. That check covers a re-login during the run. - `sync` never writes to the host database, so the empty table stays empty. - **2.x host (table has rows):** unchanged. `seed` replaces the runtime rows with the host rows, and `sync` uses `UPDATE ... WHERE id=? AND value=?`. - **Removed:** the `on_host` column and the insert path that copied imported rows into the host database. - `seed` records which store it chose, and `sync` follows that choice. So if the host upgrades to 2.x during a run, that run still writes to `auth.json`; the next run switches to the database on its own. I also updated the matching comment in `scripts/opencode-entrypoint.sh`. **Tests (`test/opencodeCredentials.test.ts`)** - I added the 1.19.6 shape (an empty `credential` table plus `auth.json`) to the existing 1.x host shapes, so each test below runs for all three: - **Run 1 refreshes the token:** the host `auth.json` gets the rotated token, the host `credential` table stays empty, and run 2 seeds the rotated token. - **Re-login between runs:** run 2 uses the new host login. - **Re-login during a run:** the host login is kept, and the next run uses it. - The existing temp-file permission test. - I deleted the two old tests that asserted the 1.x-to-database migration. - For the 2.x path with a populated table, there are separate tests for seeding, refresh write-back (with `auth.json` left alone), host replacement during a run, and host deletion during a run. When I put the old script back, the four empty-table tests fail and the rest pass, so the new tests catch the bug you reported. There's no visual change, so I didn't create a preview. PR: #3820 Comment by: @integry (ID: 7218145397) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
I retested 1982b02 in the built image, starting from a copy of a real 1.x host (an empty
One cleanup before merge: the commit adds a build artifact, |
|
✅ Applied the requested follow-up changes in commit 60b57b3 Summary of ChangesI removed the
There is nothing to see on screen here, so I made no preview. Review digestRisk-tiered paths
Diff size: 3 files changed, +15/−3 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I removed the `.pyc` file and made two changes so it doesn't come back:
- **Deleted** `scripts/__pycache__/opencode-credentials.cpython-311.pyc`. The deletion shows in the working tree as ` D`.
- **Test:** in `test/opencodeCredentials.test.ts`, every Python call now goes through one helper, `runPython`, which sets `PYTHONDONTWRITEBYTECODE=1`. That covers the `seed`/`sync` runs and the temp-file-mode check that imports the script, which is most likely what created the `.pyc`. The three separate `execFileSync('python3', …)` calls are gone.
- **`.gitignore`:** added `__pycache__/` and `*.pyc`.
`test/opencodeCredentials.test.ts` passes all 16 tests, and `scripts/__pycache__` was not created again during the run. The Dockerfile still copies only `scripts/opencode-credentials.py`, so the image is unchanged.
There is nothing to see on screen here, so I made no preview.
PR: #3820
Comment by: @integry (ID: 7218334791)
Model: Claude Opus 5.5
ProPR-Agent: claude/claude-opus-5-5
|
CI failed: Finalize unsigned validation checksums Please investigate and fix this CI failure.
Failure evidence
|
|
ℹ️ Analyzed the follow-up request by @propr-dev[bot] Analysis SummaryI made no code change. The failure came from GitHub's runner, not from this branch, and a rerun of the job should fix it. What failed: In run 46000139232, attempt 1, all four unsigned packaging jobs passed: linux-x64, linux-arm64, darwin-x64 and darwin-arm64. The runner image comes with Microsoft's package source already configured. That server briefly refused the request with a 403, so apt exited with an error and the step failed. The steps that download the artifacts and check the checksums never ran. Why it's temporary:
Next step: rerun the I didn't harden the workflow, for example by removing the Microsoft source or tolerating I also saved a memory note so this failure is quicker to recognise next time. No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryI resolved all three conflicted files and no conflict markers remain anywhere in the repo. The two branches changed different agents: the PR upgrades OpenCode to 2.4.2 (now installed under 1.
2.
3.
4.
Checks
Some 🤖 Resolution Details
System-triggered merge conflict resolution |
Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - Dockerfile.agent - packages/core/src/agents/version/types.ts - scripts/build-images.sh PR: #3820 Model: Claude Opus 5.5
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR updates OpenCode to 2.4.2 with version-specific runner behavior and credential transfer into disposable databases. It needs a localized correction to distinguish an empty OpenCode 2 credential store from a legacy store. ✅ Safe database refreshes — Conditional updates preserve host credentials replaced or deleted during a task. ✅ Startup ownership fix — The entrypoint runs schema initialization and the version probe as ✅ Legacy refresh coverage — Added tests cover three legacy host shapes, refreshed tokens, host re-login, and temporary-file permissions. This assessment is based on static review only. The supplied current checks show no failures and 13 pending. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F3: 🔴 Empty modern stores resurrect legacy credentials
SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Update credential migration documentation
S4: 🟢 Use an explicit bytecode flag
ScoreThe upgrade has focused compatibility handling and useful regression coverage, but the empty modern-store case can restore credentials removed from the host’s authoritative store. That should be corrected before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
I checked F3 against the real CLIs, and it's confirmed. OpenCode 2.4.2's Telling the formats apart: use the schema, not the row count. A DB created by 1.19.6 has
Please put the check in one helper with a comment naming the marker tables, so a future OpenCode schema change has one place to update. Regression tests:
S4 is correct, please take it too: |
|
✅ Applied the requested follow-up changes in commit aca04de Summary of ChangesI've fixed F3: when a 2.x host has logged out of everything, the leftover Format check (
Tests (
Docs and entrypoint
This change isn't visible in any UI, so there are no previews. Review digestRisk-tiered paths
Diff size: 4 files changed, +80/−23 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I've fixed F3: when a 2.x host has logged out of everything, the leftover `auth.json` no longer brings those credentials back. I also took S4 and updated the docs paragraph (S3). All 18 `opencodeCredentials` tests and all 45 `opencodeAgent` tests pass. I haven't run this in the built image or against the real CLIs. **Format check (`scripts/opencode-credentials.py`)** - A new helper, `is_opencode2_store(source)`, decides the format from the schema. The host is 2.x if its DB has a `credential` table plus at least one marker table. The markers are listed in one constant, `OPENCODE2_MARKER_TABLES`, with a comment naming them, so a future schema change only needs that line updated. - I used only `session_v2` and `machine` as markers. I left out `kv`, `job` and `worktree` because they are generic names that might also exist in some 1.x database. The comment lists the other 2.4.2 tables. - **2.x host:** `seed` always runs `DELETE FROM credential` on the runtime DB and then inserts the host rows. When the host has none, the task gets no credentials. `sync` takes the DB path and never writes `auth.json`. - **Anything else** (no DB, no `credential` table, or a 1.x schema): the `auth.json` path is unchanged. - **One behaviour change:** a DB with credential rows but no marker table now goes down the `auth.json` path. Before, it was treated as 2.x because it had rows. A real 1.x CLI never writes rows, so this should only matter if a future schema change drops both marker tables. **Tests (`test/opencodeCredentials.test.ts`)** - **Logout regression (new):** a 2.x-schema host with an empty `credential` table and a stale `auth.json`. After `seed` the runtime has no credentials. `sync` leaves `auth.json` unchanged, even after the task adds a credential of its own, and adds nothing to the host DB. This is the only test that fails against the previous version of the script. - **2.x host with rows:** the existing tests now build the host DB with 2.x tables (`migration`, `session_v2`, `machine`) and keep the stale `auth.json`. Results are unchanged: only the host rows are used, and `auth.json` is left alone. - **1.x host with an empty `credential` table:** the fixture now uses 1.x tables (`data_migration`, no `session_v2`), so the existing four `auth.json`-path tests go through the classifier. A new test also confirms that the credentials imported from `auth.json` survive `seed` and that refreshes reach `auth.json`. - **S4:** Python now runs with `-I -B` and the ignored `PYTHONDONTWRITEBYTECODE` setting is gone. No `scripts/__pycache__` appears after a run. **Docs and entrypoint** - The OpenCode paragraph in `docs/docs/architecture/agent-runtime.md` now explains the schema-based check, the empty-but-authoritative 2.x case, and that ProPR never writes `auth.json` for 2.x hosts. It also drops an out-of-date sentence saying the first run copies imported credentials into the host DB. - I updated the matching comment in `scripts/opencode-entrypoint.sh`. This change isn't visible in any UI, so there are no previews. PR: #3820 Comment by: @integry (ID: 7220333558) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR upgrades OpenCode to 2.4.2 with version-specific invocation, disposable credential storage, and updated packaging. The changes are appropriately scoped. No merge blocker was verified in the supplied diff; merge readiness remains conditional on pending checks. ✅ Credential store classification — Schema markers distinguish legacy hosts from logged-out 2.x hosts, preventing stale ✅ Controlled refresh persistence — Database updates compare original credential values, while legacy write-back preserves unrelated fields and creates temporary files with restricted permissions. ✅ Startup ownership fix — The entrypoint probes OpenCode as This was a static review of the supplied code; no commands or tests were run. Current checks show zero failures and twelve pending. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S5: 🟢 Automate real CLI credential fixturesThe new credential tests construct schemas and simulate imports themselves. An optional integration test using the pinned CLI would help detect divergence in schema markers, imported OAuth fields, and logout behavior. The supplied history demonstrates why these contracts matter; the current focused tests already cover the corrected transfer logic. S6: 🟢 Cover legacy invocation explicitlyAdd optional regression coverage for exact 1.x version resolution and the legacy task and scout flags. These compatibility branches remain in ScoreThe implementation addresses the demonstrated upgrade problems with localized fixes and focused regression coverage. Static review found no verified blocker, and current checks have no failures, though validation is still pending. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
OpenCode 2.x runs now receive extension MCP servers, skill bundles and the `propr` MCP server, and OpenCode 1.x stays unsupported. I checked this against a real OpenCode 2.4.2 install with a mock model: - The run sees only its own servers and skill. - A stdio stub through the bridge receives its secret. - The gateway gets the bearer token. - `execute` steps display under the tool names they called. The base branch didn't have #3820. The epic branch was cut before OpenCode 2.4.2 landed on `main`, so I applied #3820's own diff unchanged (it applied cleanly). Those identical lines should merge cleanly when the epic picks up `main`, but the diff includes #3820's 26 files, not just this issue's. How it works - Config: the builder is in `packages/core/src/agents/mcpLaunch/openCodeMcpLaunch.ts`, registered as `opencode`. It writes `mcp.servers` and `skills.paths` into `OPENCODE_CONFIG_CONTENT`, merged with any existing inline config, in the shape from the issue. - Secrets: remote servers use `Bearer {env:VAR}`. Tokens and stdio secrets reach the container as `-e NAME` only; their values are never in arguments or config. - Launch: `OpenCodeAgent.executeTask` sets `extensionAgentLaunch` and passes the variables through the docker process environment. The container now joins the policy's Docker network, so `propr` at `api:4000` is reachable. - Exclusive mode: an inline empty `mcp.servers` does not remove host servers on 2.4.2, because OpenCode deep-merges its config sources. So I used the disposable config dir: - The launcher sets `OPENCODE_CONFIG_PROJECT_DISABLE=1`, `OPENCODE_DISABLE_CLAUDE_CODE=1` and an empty `OPENCODE_CONFIG`. - `scripts/opencode-entrypoint.sh` builds a copy of the host config dir with `mcp` and `skills` stripped and the `skills/` folders left out. Everything else links back to the host dir, so the user's providers still work. - The mounted host dir is never changed, and the run fails if a config file can't be rewritten. - Skills: OpenCode loads the staged bundles natively and uses the bundle folder name as the skill id. The prompt pointer is still added. - Display: an `execute` step that called tools now shows under their names (e.g. `docs.lookup`) with the call's input, in both the live view and persisted logs. A script that called no tool stays an `execute` step. - Capability map: OpenCode is turned on with the existing 2.x-only condition. Beyond the issue text - An agent pinned to 1.x now fails a run that has servers or skills with a clear error instead of silently ignoring them. - The automation save checks and the UI now take the agent's CLI version into account. To do that, the instance catalog gained an optional `cliVersion` field. - Updated the UI hints, docs, CHANGELOG and the OpenAPI description, and regenerated the OpenAPI spec and client types. - Tests that used OpenCode as the "unsupported runtime" example now use OpenCode pinned to 1.19.6. One gap: OpenCode always loads `~/.agents/skills` from the container home, and no setting turns that off. The agent image doesn't create that folder, so nothing loads from it today. Tests: all pass. - The new `test/openCodeExtensionRuntime.test.ts` covers: - a config snapshot for each server kind, with no secrets in arguments, config or serialized results - the exclusive switches overriding the user's own env vars, and the 1.x refusal - the entrypoint step, including the failing case - the bridge smoke test - both parsers, using a captured real 2.4.2 output fixture - Its live end-to-end case only runs when `PROPR_OPENCODE_BIN` is set. It passed against 2.4.2, with host, project and `~/.claude` servers and skills all excluded. - I added OpenCode cases to `extensionTaskAutoApply` and `extensionPackageServers`. - The related root, core, API and UI suites pass. - ESLint is clean with zero warnings, and the core, API, shared and UI typechecks are clean. - Some root suites need `--experimental-test-module-mocks` to run locally. I captured two previews of the automation editor with an OpenCode 1.x agent selected: the new Additional extensions hint, and the locked ProPR tools hint. ProPR-Agent: claude/claude-opus-5-5
…rs, skills, ProPR MCP) (#3861) * chore: pass extension MCP servers and skills to OpenCode 2.x runs OpenCode 2.x runs now receive extension MCP servers, skill bundles and the `propr` MCP server, and OpenCode 1.x stays unsupported. I checked this against a real OpenCode 2.4.2 install with a mock model: - The run sees only its own servers and skill. - A stdio stub through the bridge receives its secret. - The gateway gets the bearer token. - `execute` steps display under the tool names they called. The base branch didn't have #3820. The epic branch was cut before OpenCode 2.4.2 landed on `main`, so I applied #3820's own diff unchanged (it applied cleanly). Those identical lines should merge cleanly when the epic picks up `main`, but the diff includes #3820's 26 files, not just this issue's. How it works - Config: the builder is in `packages/core/src/agents/mcpLaunch/openCodeMcpLaunch.ts`, registered as `opencode`. It writes `mcp.servers` and `skills.paths` into `OPENCODE_CONFIG_CONTENT`, merged with any existing inline config, in the shape from the issue. - Secrets: remote servers use `Bearer {env:VAR}`. Tokens and stdio secrets reach the container as `-e NAME` only; their values are never in arguments or config. - Launch: `OpenCodeAgent.executeTask` sets `extensionAgentLaunch` and passes the variables through the docker process environment. The container now joins the policy's Docker network, so `propr` at `api:4000` is reachable. - Exclusive mode: an inline empty `mcp.servers` does not remove host servers on 2.4.2, because OpenCode deep-merges its config sources. So I used the disposable config dir: - The launcher sets `OPENCODE_CONFIG_PROJECT_DISABLE=1`, `OPENCODE_DISABLE_CLAUDE_CODE=1` and an empty `OPENCODE_CONFIG`. - `scripts/opencode-entrypoint.sh` builds a copy of the host config dir with `mcp` and `skills` stripped and the `skills/` folders left out. Everything else links back to the host dir, so the user's providers still work. - The mounted host dir is never changed, and the run fails if a config file can't be rewritten. - Skills: OpenCode loads the staged bundles natively and uses the bundle folder name as the skill id. The prompt pointer is still added. - Display: an `execute` step that called tools now shows under their names (e.g. `docs.lookup`) with the call's input, in both the live view and persisted logs. A script that called no tool stays an `execute` step. - Capability map: OpenCode is turned on with the existing 2.x-only condition. Beyond the issue text - An agent pinned to 1.x now fails a run that has servers or skills with a clear error instead of silently ignoring them. - The automation save checks and the UI now take the agent's CLI version into account. To do that, the instance catalog gained an optional `cliVersion` field. - Updated the UI hints, docs, CHANGELOG and the OpenAPI description, and regenerated the OpenAPI spec and client types. - Tests that used OpenCode as the "unsupported runtime" example now use OpenCode pinned to 1.19.6. One gap: OpenCode always loads `~/.agents/skills` from the container home, and no setting turns that off. The agent image doesn't create that folder, so nothing loads from it today. Tests: all pass. - The new `test/openCodeExtensionRuntime.test.ts` covers: - a config snapshot for each server kind, with no secrets in arguments, config or serialized results - the exclusive switches overriding the user's own env vars, and the 1.x refusal - the entrypoint step, including the failing case - the bridge smoke test - both parsers, using a captured real 2.4.2 output fixture - Its live end-to-end case only runs when `PROPR_OPENCODE_BIN` is set. It passed against 2.4.2, with host, project and `~/.claude` servers and skills all excluded. - I added OpenCode cases to `extensionTaskAutoApply` and `extensionPackageServers`. - The related root, core, API and UI suites pass. - ESLint is clean with zero warnings, and the core, API, shared and UI typechecks are clean. - Some root suites need `--experimental-test-module-mocks` to run locally. I captured two previews of the automation editor with an OpenCode 1.x agent selected: the new Additional extensions hint, and the locked ProPR tools hint. ProPR-Agent: claude/claude-opus-5-5 * test: pin OpenCode 1.x in extension runtime skip test I fixed the Shard 3/4 failure. It was one stale test, not a code bug. **Cause:** in `packages/shared/test/extensionLibrary.test.ts`, the case "explicit entries that are missing, disabled or out of limits are skipped with a reason" uses OpenCode with no version as its example of a runtime that can't receive extensions. Its last assertion expected the `docs` server to be skipped with reason `runtime`. This PR turns extensions on for OpenCode 2.x, and a runtime with no version gets the mapped capabilities. So `docs` now applies, `skipped` is empty, and `skipped[0].reason` threw `Cannot read properties of undefined (reading 'reason')`. **Fix:** that assertion now passes `cliVersion: '1.19.6'`, the same OpenCode 1.x pin this PR already uses in the other "unsupported runtime" tests. It's a one-line change, and it still checks the skip with reason `runtime`. **Verification:** that file now passes 11/11, and all of `packages/shared/test/*.test.ts` passes (136 pass, 0 fail). This was the only failing test in the shard; the other 281 files passed. There are no visual changes, so I made no preview. PR: #3861 Comment by: @propr-dev[bot] (ID: 7229795304) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5 * chore: strip JSONC trailing commas after comments in entrypoint I fixed F2 and added regression tests for both findings. I did not change the F1 production code, because the failure it describes can't happen in the current code. **F2 (fixed)** — `scripts/opencode-entrypoint.sh`: the JSONC cleanup now runs in two passes, both of which skip over string contents. Comments are removed first and trailing commas second. Before, comments and commas were handled in a single pass, so a comma followed by a comment and then `}` or `]` was kept. Block comments are replaced with a space so the tokens on either side don't join. The new entrypoint test covers: - `{"model":"acme/m", /* explanation */ }` - a trailing comma before a `//` line comment in an array - several comments after a trailing comma - a string value containing `, }`, `//` and `/* */`, which must come through unchanged The new test fails against the old entrypoint and passes with the fix. **F1 (stated failure doesn't occur; regression added)** — The review's trace assumes an agent's own `OPENCODE_CONFIG_CONTENT` reaches the Docker arguments through `...envVars`. It doesn't. `openCodeEnvForwarding.ts` lists `OPENCODE_CONFIG_CONTENT` as a ProPR-managed variable, so `buildEnvVars` drops it with the warning "Skipping OpenCode env var managed by ProPR". That rule is unchanged from `main` (it came in with #3031). So there is never an earlier assignment for the run's config to override, and passing `undefined` on the normal-task path is correct. The only existing inline config a run can have is the scout config, and the scout path already merges into it and emits it once. Making the agent's value merge into the launch would mean reversing that #3031 hardening decision, which is a policy change beyond this finding. I added a Docker-argument test instead. It sets an inline provider in the agent's `envVars` and checks two runs, one with extension servers in exclusive mode and one with only the ProPR server. In both there is exactly one `OPENCODE_CONFIG_CONTENT` assignment and it is the run's config. With no tool policy there is none. **Other notes:** - A provider set through `OPENCODE_CONFIG_CONTENT` in the agent's variables has always been dropped, with or without this PR. Inline provider settings only work through the mounted config directory, which the exclusive-mode entrypoint keeps. If merging the agent's own inline config is wanted, it needs a separate decision about that hardening rule. - I ran `git stash` by mistake while checking lint. It failed because the git directory is read-only, so nothing changed, and both edited files are intact. **Verification:** `test/openCodeExtensionRuntime.test.ts` passes, 20 of 20. The live OpenCode case is skipped because it needs `PROPR_OPENCODE_BIN`. `bash -n` finds no syntax errors in the entrypoint. ESLint has no config that covers `test/`, so the test file isn't linted. PR: #3861 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5 --------- Co-authored-by: propr-dev[bot] <1316198+propr-dev[bot]@users.noreply.github.com>
Goal Implementation Summary
✅ Goal completed successfully.
Goal: Upgrade OpenCode to next major version (move from series 1 to 2)
Branch:
goal-9ed2d2e8/gpt-6.2-astra-upgrade-opencode-to-next--20261126-1141-vbbGoal ID:
9ed2d2e8-4c58-4078-be03-fac7068c91b2Summary of Changes
I’ll check how the worktree installs and uses OpenCode, then verify the available series 2 release before changing the integration.
I installed OpenCode 2.4.2 and confirmed three integration changes. It uses the
@opencode/clipackage, takes--autofor unattended runs, and stores credentials in SQLite. I’ll update the runner and check that task containers can use those credentials while keeping session data disposable.A live run through the updated wrapper returned the expected text. ProPR parsed its session ID and token counts from the JSON stream. I’ll now verify credential refresh handling, the scout’s restricted tool access, and the image packaging checks.
{"checkpointReady":true,"message":"feat(opencode): upgrade the bundled CLI and runner to 2.4.2","include":["Dockerfile.agent","docker/Dockerfile.app.prod","scripts/build-images.sh","scripts/opencode-run.sh","scripts/opencode-entrypoint.sh","scripts/opencode-credentials.py","scripts/generate-notices.sh","THIRD_PARTY_LICENSES.md","packages/shared/src/modelDefinitions.ts","packages/core/src/agents/version/types.ts","packages/core/src/agents/version/versionService.ts","packages/core/src/agents/impl/openCodeUtils.ts","packages/core/src/agents/impl/utils/repositoryScoutMcpServer.ts","packages/core/test/nativeLogPolicyLive.test.ts","packages/cli/README.md","docs/docs/architecture/agent-runtime.md","docs/docs/features/agents-and-models.md","docs/docs/tutorials/setup-vps.md","test/agentVersionManagement.test.ts","test/apiOpenCodeRoutes.test.ts","test/opencodeAgent.test.ts","test/reviewContextScoutRuntime.test.ts","test/sharedModelDefinitions.test.ts"],"summary":"Upgrades the default OpenCode runtime from 1.19.6 to 2.4.2 and preserves explicit series 1 pins. All 133 focused tests passed. A live task verified prompt delivery, response parsing, session ID and token usage. Credential checks verified import, refresh and concurrent login preservation. The live scout tool call remains unverified after the provider returned HTTP 429. Docker was unavailable for a full image build."}
The upgrade checkpoint is published. I’ll verify the remaining scout path with the installed 2.4.2 CLI and a local provider fixture, so the check can run independently of the hosted provider’s rate limit.
Upgraded the default OpenCode CLI from 1.19.6 to 2.4.2. Explicit series 1 pins remain supported. ProPR published the changes in commit
9acd966.All 133 focused tests passed. A live task verified prompt delivery, response parsing, and token usage. A local provider fixture verified that the scout exposed only its three repository tools and successfully read a file. Credential import, refresh, and concurrent login preservation also passed.
Docker was unavailable, so the full agent image build remains unverified. Elapsed time was 7 minutes 34 seconds.
🤖 Implementation Details
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback.
This PR description was updated automatically by ProPR after the goal completed.