Skip to content

[Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 - #3820

Merged
integry merged 12 commits into
mainfrom
goal-9ed2d2e8/gpt-6.2-astra-upgrade-opencode-to-next--20261126-1141-vbb
Nov 27, 2026
Merged

integry merged 12 commits into
mainfrom
goal-9ed2d2e8/gpt-6.2-astra-upgrade-opencode-to-next--20261126-1141-vbb

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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-vbb
Goal ID: 9ed2d2e8-4c58-4078-be03-fac7068c91b2

Summary 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/cli package, takes --auto for 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

  • Model: GPT-6.2 Astra
  • Time: 10m 45s
  • Tokens: 6,559,469 (6,546,028 in / 13,441 out)

💡 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.

@propr-dev propr-dev Bot added the AI label Nov 26, 2026
@propr-dev

propr-dev Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate Changes

Please investigate and fix this CI failure.

Failure evidence

.github:8
Process completed with exit code 1.

.github:415
Process completed with exit code 1.

@github-actions

Copy link
Copy Markdown

Checks Failed

Validation failed during setup, tests, CLI packaging, linting, or build checks.

View Logs
Build check diagnostics for run 45814339050, attempt 1
Checkout outcome: success

--- GitHub Actions workflow lint ---
docker.io/rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667: Pulling from rhysd/actionlint
589002ba0eae: Pulling fs layer
c09af8888d6a: Pulling fs layer
4ccd7d76ca98: Pulling fs layer
b6b4b7b0e257: Pulling fs layer
b6b4b7b0e257: Waiting
c09af8888d6a: Verifying Checksum
c09af8888d6a: Download complete
4ccd7d76ca98: Verifying Checksum
4ccd7d76ca98: Download complete
589002ba0eae: Verifying Checksum
589002ba0eae: Download complete
589002ba0eae: Pull complete
c09af8888d6a: Pull complete
b6b4b7b0e257: Verifying Checksum
b6b4b7b0e257: Download complete
4ccd7d76ca98: Pull complete
b6b4b7b0e257: Pull complete
Digest: sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
Status: Downloaded newer image for rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
docker.io/rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667

--- Release shell script lint ---

--- Toolchain ---
v22.23.5
10.9.9

--- Dependency installation ---
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]

added 1112 packages, and audited 1121 packages in 49s

318 packages are looking for funding
  run `npm fund` for details

8 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

--- CLI release package ---
Verifying propr-cli release package...

> [email protected] cli:pack
> node packages/cli/scripts/build-publish.mjs


> @propr/[email protected] build
> tsc


> @propr/[email protected] build
> tsc


> @propr/[email protected] build
> tsc && node scripts/copy-assets.mjs

copy-assets: copied 9 file(s) into the CLI package.

Staged [email protected] at /home/runner/work/propr/propr/dist-publish/propr-cli
npm notice
npm notice 📦  [email protected]
npm notice Tarball Contents
npm notice 31.8kB README.md
npm notice 36.3kB dist/agentSkill.js
npm notice 477B dist/api/admission.js
npm notice 754B dist/api/agentRuntime.js
npm notice 7.1kB dist/api/agents.js
npm notice 2.6kB dist/api/agentTank.js
npm notice 4.4kB dist/api/automations.js
npm notice 13.3kB dist/api/client.js
npm notice 5.9kB dist/api/errors.js
npm notice 1.6kB dist/api/followupHandoffs.js
npm notice 16.9kB dist/api/goals.js
npm notice 6.0kB dist/api/implement.js
npm notice 2.9kB dist/api/index.js
npm notice 1.9kB dist/api/logs.js
npm notice 7.7kB dist/api/plans.js
npm notice 586B dist/api/pullRequests.js
npm notice 4.2kB dist/api/relay.js
npm notice 12.5kB dist/api/repos.js
npm notice 2.5kB dist/api/repositoryEvents.js
npm notice 16.2kB dist/api/settings.js
npm notice 2.0kB dist/api/stats.js
npm notice 1.6kB dist/api/syntheticPools.js
npm notice 1.8kB dist/api/system.js
npm notice 5.9kB dist/api/tasks.js
npm notice 2.9kB dist/api/todos.js
npm notice 86B dist/api/types.js
npm notice 313B dist/api/visualPreviewAuth.js
npm notice 32.9kB dist/assets/env.example.txt
npm notice 5.9kB dist/auth/githubLogin.js
npm notice 5.0kB dist/auth/verifyToken.js
npm notice 9.0kB dist/commands/admissionCommands.js
npm notice 19.7kB dist/commands/agentCommands.js
npm notice 4.2kB dist/commands/agentPoolCommands.js
npm notice 4.3kB dist/commands/agentSkillCommands.js
npm notice 30.0kB dist/commands/agentValidation.js
npm notice 31.2kB dist/commands/automationCommands.js
npm notice 72.3kB dist/commands/checkCommands.js
npm notice 8.9kB dist/commands/configCommands.js
npm notice 14.6kB dist/commands/connectCommand.js
npm notice 12.2kB dist/commands/eventCommands.js
npm notice 5.5kB dist/commands/githubAppApi.js
npm notice 27.7kB dist/commands/githubAppCommands.js
npm notice 60.9kB dist/commands/goalCommands.js
npm notice 9.4kB dist/commands/handoffCommands.js
npm notice 2.4kB dist/commands/imageCommands.js
npm notice 8.6kB dist/commands/implementCommands.js
npm notice 2.0kB dist/commands/index.js
npm notice 8.4kB dist/commands/initCommands.js
npm notice 14.1kB dist/commands/initStack.js
npm notice 6.1kB dist/commands/logCommands.js
npm notice 26.5kB dist/commands/planCommands.js
npm notice 3.1kB dist/commands/prCommands.js
npm notice 8.4kB dist/commands/relayCommands.js
npm notice 41.4kB dist/commands/repoCommands.js
npm notice 2.7kB dist/commands/repoValidate.js
npm notice 7.5kB dist/commands/runtimeCommands.js
npm notice 19.8kB dist/commands/settingCommands.js
npm notice 4.6kB dist/commands/setup/agentHostActions.js
npm notice 123B dist/commands/setup/agents.js
npm notice 4.7kB dist/commands/setup/engine.js
npm notice 51B dist/commands/setup/github.js
npm notice 37.3kB dist/commands/setup/hostActions.js
npm notice 3.2kB dist/commands/setup/imagePlatform.js
npm notice 27.3kB dist/commands/setup/sequential.js
npm notice 51B dist/commands/setup/state.js
npm notice 51B dist/commands/setup/types.js
npm notice 10.7kB dist/commands/setupCommand.js
npm notice 4.4kB dist/commands/stackCommands.js
npm notice 1.4kB dist/commands/startCommand.js
npm notice 4.8kB dist/commands/statsCommands.js
npm notice 4.9kB dist/commands/statsCostCommand.js
npm notice 14.8kB dist/commands/systemCommands.js
npm notice 3.5kB dist/commands/tankCommands.js
npm notice 47.6kB dist/commands/taskCommands.js
npm notice 29.7kB dist/commands/todoCommands.js
npm notice 31.0kB dist/commands/tunnelCommand.js
npm notice 2.7kB dist/commands/uiDocsCommands.js
npm notice 8.3kB dist/completion.js
npm notice 27.3kB dist/config/ConfigManager.js
npm notice 276B dist/config/index.js
npm notice 989B dist/config/rootKey.js
npm notice 345B dist/config/types.js
npm notice 46.0kB dist/connectIdentity.js
npm notice 25.0kB dist/connectRootAuthority.js
npm notice 32.5kB dist/connectWindowsAuthority.js
npm notice 2.2kB dist/desktopDiscovery.js
npm notice 13.3kB dist/desktopLocalSetup.js
npm notice 17.4kB dist/index.js
npm notice 4.5kB dist/native/darwin-authority-broker.c
npm notice 8.9kB dist/native/directory-operations.c
npm notice 50.1kB dist/native/prebuilds/darwin-arm64/connect-authority-broker
npm notice 54.2kB dist/native/prebuilds/darwin-arm64/directory-operations.node
npm notice 17.1kB dist/native/prebuilds/darwin-x64/connect-authority-broker
npm notice 24.3kB dist/native/prebuilds/darwin-x64/directory-operations.node
npm notice 28.9kB dist/native/prebuilds/linux-arm64/directory-operations.node
npm notice 17.4kB dist/native/prebuilds/linux-x64/directory-operations.node
npm notice 1.2kB dist/native/README.md
npm notice 3.1kB dist/orchestrator/format.js
npm notice 13.4kB dist/orchestrator/index.js
npm notice 302B dist/orchestrator/manifest.json
npm notice 131.2kB dist/orchestrator/orchestrator.mjs
npm notice 408B dist/orchestrator/types.js
npm notice 6.2kB dist/rootHelp.js
npm notice 237B dist/skill/propr/agents/openai.yaml
npm notice 8.9kB dist/skill/propr/SKILL.md
npm notice 4.5kB dist/tui/AgentTableApp.js
npm notice 4.5kB dist/tui/app.js
npm notice 11.6kB dist/tui/CheckApp.js
npm notice 5.1kB dist/tui/render.js
npm notice 32.5kB dist/tui/SetupApp.js
npm notice 18.4kB dist/tui/SetupApp.test.js
npm notice 8.2kB dist/tui/StartApp.js
npm notice 3.8kB dist/utils/apiErrorPresentation.js
npm notice 12.0kB dist/utils/directoryDescriptor.js
npm notice 739B dist/utils/dockerPort.js
npm notice 5.0kB dist/utils/envFile.js
npm notice 520B dist/utils/index.js
npm notice 5.7kB dist/utils/io.js
npm notice 717B dist/utils/localSetupPlatform.js
npm notice 1.5kB dist/utils/nativeArtifact.js
npm notice 544B dist/utils/parseState.js
npm notice 417B dist/utils/positiveInteger.js
npm notice 4.5kB dist/utils/privateFilesystem.js
npm notice 4.2kB dist/utils/resolveProject.js
npm notice 7.2kB dist/vendor/local-setup/agents.js
npm notice 64.5kB dist/vendor/local-setup/engine.js
npm notice 5.0kB dist/vendor/local-setup/envFile.js
npm notice 11.4kB dist/vendor/local-setup/github.js
npm notice 188B dist/vendor/local-setup/index.js
npm notice 27.5kB dist/vendor/local-setup/publicInstanceIdentity.js
npm notice 14.6kB dist/vendor/local-setup/state.js
npm notice 2.8kB dist/vendor/local-setup/types.js
npm notice 13.2kB dist/vendor/shared/acceptanceCriteria.js
npm notice 1.0kB dist/vendor/shared/accountStatusTimestamp.js
npm notice 7.7kB dist/vendor/shared/activityEvents.js
npm notice 2.8kB dist/vendor/shared/agentConfigRedaction.js
npm notice 4.4kB dist/vendor/shared/agentDefinitions.js
npm notice 2.3kB dist/vendor/shared/agentFailureLine.js
npm notice 3.4kB dist/vendor/shared/agentLogin.js
npm notice 3.1kB dist/vendor/shared/agentTank.js
npm notice 1.2kB dist/vendor/shared/agentTankHistory.js
npm notice 2.8kB dist/vendor/shared/analyticsTimeframe.js
npm notice 4.4kB dist/vendor/shared/antigravityCompatibility.js
npm notice 5.1kB dist/vendor/shared/apiOrigin.js
npm notice 3.5kB dist/vendor/shared/assignment.js
npm notice 17.2kB dist/vendor/shared/automationDefinitions.js
npm notice 9.2kB dist/vendor/shared/automationReportPreview.js
npm notice 2.4kB dist/vendor/shared/automationRunProductivity.js
npm notice 6.4kB dist/vendor/shared/automationTemplateContract.js
npm notice 18.5kB dist/vendor/shared/automationTemplates.catalog.json
npm notice 1.3kB dist/vendor/shared/automationTemplates.js
npm notice 3.4kB dist/vendor/shared/changedFileKinds.js
npm notice 1.4kB dist/vendor/shared/claudeCompatibility.js
npm notice 12.1kB dist/vendor/shared/commitSubject.js
npm notice 8.5kB dist/vendor/shared/connectDiscovery.js
npm notice 9.6kB dist/vendor/shared/cronSchedule.js
npm notice 254B dist/vendor/shared/demoMode.js
npm notice 4.3kB dist/vendor/shared/desktopPairing.js
npm notice 481B dist/vendor/shared/desktopTokenRevocation.js
npm notice 8.9kB dist/vendor/shared/events.js
npm notice 13.0kB dist/vendor/shared/extensionLibrary.js
npm notice 703B dist/vendor/shared/extensionOAuth.js
npm notice 4.0kB dist/vendor/shared/extensionPackages.js
npm notice 2.9kB dist/vendor/shared/extensionProfiles.js
npm notice 2.7kB dist/vendor/shared/fleetData.js
npm notice 2.5kB dist/vendor/shared/githubAppManifest.js
npm notice 1.6kB dist/vendor/shared/githubAuthMode.js
npm notice 2.0kB dist/vendor/shared/githubEventIntakeMode.js
npm notice 12.8kB dist/vendor/shared/goalBlockers.js
npm notice 6.0kB dist/vendor/shared/goalCheckpoints.js
npm notice 4.0kB dist/vendor/shared/goalCreation.js
npm notice 5.2kB dist/vendor/shared/goalWait.js
npm notice 14.5kB dist/vendor/shared/index.js
npm notice 214B dist/vendor/shared/instanceAuthorization.js
npm notice 54B dist/vendor/shared/instanceCatalog.js
npm notice 584B dist/vendor/shared/instanceStorage.js
npm notice 4.0kB dist/vendor/shared/intakeModePrerequisites.js
npm notice 2.9kB dist/vendor/shared/labelUtils.js
npm notice 21.0kB dist/vendor/shared/modelDefinitions.js
npm notice 3.5kB dist/vendor/shared/notificationLinks.js
npm notice 51.3kB dist/vendor/shared/notifications.js
npm notice 2.9kB dist/vendor/shared/openCodeCompatibility.js
npm notice 16.9kB dist/vendor/shared/planItemGraph.js
npm notice 7.5kB dist/vendor/shared/previewStorage/v1.js
npm notice 866B dist/vendor/shared/projectSlug.js
npm notice 3.8kB dist/vendor/shared/proprCompatibility.js
npm notice 884B dist/vendor/shared/proprRuntimePaths.js
npm notice 13.0kB dist/vendor/shared/proprServiceUrls.js
npm notice 17.0kB dist/vendor/shared/prTemplate.js
npm notice 6.9kB dist/vendor/shared/prTitleStatusSlot.js
npm notice 2.2kB dist/vendor/shared/publishedVisualPreviews.js
npm notice 2.7kB dist/vendor/shared/reasoningLevels.js
npm notice 1.8kB dist/vendor/shared/repositoryEvents.js
npm notice 6.7kB dist/vendor/shared/repositoryEventWait.js
npm notice 1.2kB dist/vendor/shared/repositoryIcon.js
npm notice 1.4kB dist/vendor/shared/repositoryIconUrl.js
npm notice 3.9kB dist/vendor/shared/repositoryPresentation.js
npm notice 10.4kB dist/vendor/shared/reviewContextBudget.js
npm notice 5.8kB dist/vendor/shared/reviewFeedbackIds.js
npm notice 2.7kB dist/vendor/shared/reviewPrompt.js
npm notice 907B dist/vendor/shared/runCostCap.js
npm notice 861B dist/vendor/shared/sessionSecret.js
npm notice 392B dist/vendor/shared/sqliteTimestamp.js
npm notice 603B dist/vendor/shared/statusKeys.js
npm notice 7.5kB dist/vendor/shared/syntheticAgents.js
npm notice 2.2kB dist/vendor/shared/taskIdentifiers.js
npm notice 2.0kB dist/vendor/shared/taskLifecycle.js
npm notice 733B dist/vendor/shared/taskReplacement.js
npm notice 957B dist/vendor/shared/text.js
npm notice 2.6kB dist/vendor/shared/tokenOutlierSettings.js
npm notice 1.9kB dist/vendor/shared/ultrafixCycle.js
npm notice 1.8kB dist/vendor/shared/unfinishedRun.js
npm notice 9.8kB dist/vendor/shared/usageTips.catalog.json
npm notice 5.0kB dist/vendor/shared/usageTips.js
npm notice 335B dist/vendor/shared/usageTypes.js
npm notice 1.1kB dist/vendor/shared/userWhitelist.js
npm notice 758B dist/vendor/shared/validateRelayUrl.js
npm notice 2.2kB dist/vendor/shared/validateRoutingUrl.js
npm notice 7.1kB dist/vendor/shared/visualPreviewCapacity.js
npm notice 9.3kB dist/vendor/shared/voice.js
npm notice 222B dist/vendor/shared/workEvidence.js
npm notice 828B package.json
npm notice Tarball Details
npm notice name: propr-cli
npm notice version: 0.9.3
npm notice filename: propr-cli-0.9.3.tgz
npm notice package size: 550.1 kB
npm notice unpacked size: 2.2 MB
npm notice shasum: 0ef9f69b65e7b5b287664cf119e56b02f8eb99fc
npm notice integrity: sha512-gvfVBlm9pFfMJ[...]n2i32UgRSKoVw==
npm notice total files: 222
npm notice
propr-cli-0.9.3.tgz

Dry run only. Re-run with --publish to publish to npm.
✅ propr-cli release package verified
Starting changed-area validation process...
Reusing this job's @propr/shared build from CLI packaging.
Reusing this job's @propr/local-setup build from CLI packaging.

--- Core Service: Lint & Build ---
✅ Core Lint passed
✅ Core Source Build passed

--- UI: Typecheck, Lint & Build ---
✅ Client Package validation passed
✅ UI Typecheck passed
✅ UI Lint passed
✅ UI Build passed

--- Docs: Typecheck & Build ---
✅ Docs Typecheck passed
✅ Docs Build passed
✅ Docs Static Serving Check passed

--- Core Package: Build & Lint ---
✅ Core Package Build passed
❌ Core Package Lint FAILED

/home/runner/work/propr/propr/packages/core/src/agents/impl/openCodeUtils.ts
  95:8  warning  Function 'buildOpenCodeDockerArgs' has a complexity of 27. Maximum allowed is 20  complexity

✖ 1 problem (0 errors, 1 warning)

ESLint found too many warnings (maximum: 0).

--- CLI: Lint ---
✅ CLI Lint passed

--- API: Build & Lint ---
✅ API Build passed
✅ API Lint passed

--- API Reference: OpenAPI Spec & Client Contract ---
✅ OpenAPI spec is current and valid
✅ @propr/client matches the OpenAPI spec

--- Stage outcomes ---
Workflow lint: success
Release shell lint: success
Pre-setup gate: skipped
Node setup: success
Toolchain: success
Dependency install: success
Release metadata: success
CLI packaging: success
Change detection: success
Changed-area checks: failure
Chromium install: skipped
PWA and mobile browser smoke: skipped

View Workflow

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 8bc2bdc

Processed 2 comments:

  • Comment 1 by @propr-dev[bot] (ID: 7191350506✓)
  • Comment 2 by @github-actions[bot] (ID: 7191350976✓)

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/core/src/agents/impl/openCodeUtils.ts (+23/−8)
  • Low risk: none

Diff size: 1 file changed, +23/−8 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot], @github-actions[bot]
  • Time: 4m 41s
  • Tokens: 424,560 (421,783 in / 2,777 out)
  • Cost: $0.38

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 7191350506✓, 7191350976✓

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
@propr-dev propr-dev Bot changed the title 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 ✅ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 26, 2026
@integry

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Tested this branch against the real OpenCode 2.4.2 CLI (@opencode/[email protected]), using a copy of a real OpenCode 1.x data directory. One bug needs fixing.

Bug: opencode-credentials.py seed wipes every credential for users upgrading from OpenCode 1.x

A data directory written by OpenCode 1.x (seen with 1.16) already has a credential table in opencode.db, but the table is empty. The credentials themselves are still in auth.json.

What happens in the entrypoint:

  1. opencode auth list --standalone initializes the disposable database. It imports auth.json correctly, so auth list shows the OpenAI (OAuth) and OpenRouter (API key) credentials.
  2. seed finds the credential table in the source database, runs DELETE FROM credential on the runtime database, and inserts the source rows. There are none.
  3. opencode auth list --standalone now prints No authenticated integrations, so the task runs without credentials.

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 seed() when SELECT count(*) FROM credential on the source is 0. Please add a test for this case: a source database with an empty credential table, plus auth.json.

The rest of the upgrade passed when tested against the real 2.4.2 CLI:

  • Live task: a run through opencode-run (--standalone, --auto) completed with a tool call. parseOpenCodeJsonl returned the session ID, text and token usage.
  • Scout: the live run exposed only the three propr_repository_* tools. Attempts to run bash or write files were refused, nothing was written, and propr_repository_read_repository_file succeeded.
  • Credential sync: with v2 credential rows already in the source database, seed and then sync wrote a refreshed token back to the source and left the other credential unchanged.

The agent image build is still untested; Docker was not available here either.

@propr-dev propr-dev Bot changed the title ✅ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 26, 2026
@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit dbb7a99

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk (1 file)
    • scripts/opencode-credentials.py (+5/−0): auth-looking path
  • Normal risk: none
  • Low risk (1 file)
    • test/opencodeCredentials.test.ts (added, +91/−0)

Diff size: 2 files changed, +96/−0 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 4m 8s
  • Tokens: 728,259 (722,966 in / 5,293 out)
  • Cost: $0.48

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7204570682✓

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
@propr-dev propr-dev Bot changed the title 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 ✅ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 26, 2026
@integry

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Retested dbb7a99 against the real OpenCode 2.4.2 CLI. The credential-wipe fix works: with a 1.x data directory (empty credential table plus auth.json), seed leaves the imported credentials alone. Both logins stay stored, a live task replied correctly, and test/opencodeCredentials.test.ts passes.

One remaining problem: on installs upgraded from 1.x, refreshed OAuth credentials are thrown away after every run.

In the empty-table case, seed now returns before creating propr_original_credential, so sync returns immediately and writes nothing back. OpenCode 2 doesn't update auth.json either: its checksum was identical before and after a live run. The entrypoint's existing auth.json copy-back therefore restores the original file.

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:

  1. In the empty-source case, seed should still record the starting credential rows, i.e. create propr_original_credential from the rows OpenCode imported out of auth.json.
  2. sync should then write changed rows back to the source database. Where the source credential table has no row with that id, insert it rather than update. After the first run the host database holds the credentials, and later runs take the normal seed/sync path.
  3. Keep the existing rule that a refresh is written back only if the host still holds the value the run started with. For rows that didn't exist on the host, write them only if they are still missing.
  4. Leave auth.json untouched so a pinned 1.x CLI keeps working.

Tests to add:

  • 1.x source (empty table plus auth.json) → a refresh during the run → the host database has the refreshed row afterwards → the next seed uses it.
  • A host row added concurrently during the run is not overwritten.

@propr-dev propr-dev Bot changed the title ✅ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 26, 2026
@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b39c0b8

Summary of Changes

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:

Review digest

Risk-tiered paths

  • High risk (1 file)
    • scripts/opencode-credentials.py (+35/−14): auth-looking path
  • Normal risk: none
  • Low risk (2 files)
    • docs/docs/architecture/agent-runtime.md (+1/−1)
    • test/opencodeCredentials.test.ts (+59/−12)

Diff size: 3 files changed, +95/−27 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 5m 37s
  • Tokens: 630,234 (622,126 in / 8,108 out)
  • Cost: $0.53
  • Subscription usage: Weekly +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7205808941✓

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
@propr-dev propr-dev Bot changed the title 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 ✅ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@integry

integry commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Tested the built agent image (docker build -f Dockerfile.agent at b39c0b8) with a real task. I ran it through OpenCodeAgent.executeTask from this branch's packages/core against a copy of a real 1.x host data directory (opencode.db + auth.json).

Bug: every OpenCode run with a host opencode.db dies at startup.

Switching to node user with disposable OpenCode state...
PlatformError: PermissionDenied: FileSystem.open (/tmp/propr-opencode-data/opencode/log/opencode.log)
  [cause]: Error: EACCES: permission denied, open '/tmp/propr-opencode-data/opencode/log/opencode.log'

Cause: scripts/opencode-entrypoint.sh:84 runs the version probe $(opencode --version) as root. This happens after the data dir has been chowned to node. OpenCode 2.4.2 opens its log file even for --version, so this creates $XDG_DATA_HOME/opencode/log/opencode.log owned by root. The su-exec node commands that follow (auth list and the task itself) can then no longer open it. OpenCode 1.19.6 has the same problem: its probe leaves log/ and repos/ owned by root. Reproduction:

docker run --rm --user 0:0 --entrypoint sh -e XDG_DATA_HOME=/tmp/d <image> -c \
  'mkdir -p /tmp/d/opencode && chown -R node:node /tmp/d; opencode --version; ls -la /tmp/d/opencode/log; su-exec node opencode --version'

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."* ]]; then

With only that line changed, the same real task passed end to end:

  • success
  • session ses_… parsed
  • tokens 8213 in / 570 out / 27264 cache-read
  • math.js and math.test.js edited, node --test 2/2 pass
  • host auth.json byte-identical afterwards

Please also add a regression check that runs the entrypoint as root (as ProPR does with --user 0:0), for example in scripts/smoke-test-images.sh. It should check that nothing under the disposable data dir is owned by root before the node-user command starts.

@propr-dev propr-dev Bot changed the title ✅ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@propr-dev

propr-dev Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit ca1ab61

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • scripts/opencode-entrypoint.sh (+3/−1)
    • scripts/smoke-test-images.sh (+28/−0)
  • Low risk (1 file)
    • test/opencodeAgent.test.ts (+9/−0)

Diff size: 3 files changed, +40/−1 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 6m 6s
  • Tokens: 1,121,904 (1,114,214 in / 7,690 out)
  • Cost: $0.64

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7215458472✓

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
@propr-dev propr-dev Bot changed the title 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 ✅ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@integry

integry commented Nov 27, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev propr-dev Bot changed the title ✅ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@propr-dev

propr-dev Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 node, preventing the root-owned log file failure described in earlier comments.

✅ 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Persist refreshes for JSON-only stores

  • Category: correctness

  • Required behavior: Credentials imported from supported legacy auth.json stores must retain OAuth refreshes across disposable OpenCode 2 runs.

  • Evidence: scripts/opencode-entrypoint.sh:86 and scripts/opencode-credentials.py:12, seed and sync.

    static trace:

    1. A mounted legacy data directory contains auth.json but no opencode.db. OpenCode 2 can import those credentials into its disposable database.
    2. The entrypoint's new -f "$source_db" condition fails, so it skips credential seeding and leaves sync_database=0.
    3. During the task, OpenCode refreshes an imported OAuth credential in the disposable database.
    4. The entrypoint skips database synchronization. The existing JSON copy-back cannot preserve a refresh stored only in SQLite, and container removal discards the refreshed credential.
    5. The next task imports the original token again. For providers that rotate refresh tokens, subsequent authentication can fail.

    The helper has the same gap when a source database exists without a credential table: seed returns before recording imported rows, and sync independently refuses that source. The empty-table fix therefore covers only one legacy-store shape. The supplied credential tests always create a source credential table, so they do not exercise either bypass. The supplied runtime context establishes that OpenCode 2 refreshes SQLite credentials without updating auth.json; the failure sequence itself was not executed during this review.

  • Minimum fix: Support persisting imported credentials when the host database or credential table is absent, initializing the required credential storage safely and retaining the concurrent-login protections. Add regression coverage for both source-store shapes.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Exercise existing-row synchronization

The new credential tests verify migration and seeding, but do not exercise the on_host=1 update path. Add cases for successful refresh persistence, an intervening host-value change, and host-row deletion. These would protect the compare-and-update behavior; they are optional because the supplied SQL already handles those cases correctly by static inspection.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 51s
  • Tokens: 68,022 (67,006 in / 1,016 out)
  • Cost: $0.61

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 S1

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 ⚠️❻ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@integry

integry commented Nov 27, 2026

Copy link
Copy Markdown
Owner

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 opencode.db, with an empty credential table, on any command; I checked with a fresh data dir and opencode auth list. So hosts that use 1.19.6, and logins through ProPR's managed login (2.x writes the DB directly), all take the seed/sync path you already fixed. The two uncovered shapes are an auth.json with no opencode.db, and an opencode.db with no credential table. They only come from much older 1.x versions or a hand-copied auth.json. In those cases a rotated OAuth refresh token is still lost when the container is removed, so please fix it, but keep the fix small.

Please don't create a database or credential table in the host data dir. If the host CLI is still 1.x, it runs its own migrations against that file on next start. A DB that already has a hand-made credential table, or none of the migration bookkeeping, can make those migrations fail. That would break the host CLI, which is worse than a lost refresh.

Suggested approach: when the host has no usable credential table, auth.json is the only credential store on the host, and OpenCode 2 imports it into the fresh disposable DB on every run. So at sync, write refreshed imported credentials back into the host auth.json in the v1 format. Write it atomically, preserve the file mode, and update only entries whose host value still equals what was seeded, so the concurrent-login protection still holds. Keep the current behavior (never touch auth.json) whenever the host has a credential table.

Please add regression tests for both shapes: a host with only auth.json, and a host DB without a credential table. Each should show that a refresh during the run reaches the host and that the next run picks it up. Also test that a host login during the run is not overwritten.

@propr-dev propr-dev Bot changed the title ⚠️❻ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
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
@integry

integry commented Nov 27, 2026

Copy link
Copy Markdown
Owner

I retested 1982b02 in the built image, starting from a copy of a real 1.x host (an empty credential table plus auth.json). The credential fix is correct:

  • A task refreshes the token: the rotated token is written to the host auth.json. The host credential table stays empty, and the file stays mode 600.
  • Host re-login between runs: the next run uses the new host login.
  • Host re-login during a run while the task also refreshes: the host's login is kept.
  • Real task: a real task on the 1.x host copy passes, and the host DB is still at 0 credential rows. opencodeCredentials and opencodeAgent tests pass.

One cleanup before merge: the commit adds a build artifact, scripts/__pycache__/opencode-credentials.cpython-311.pyc. It was most likely generated when the test imported the script. Please delete it. Then stop it coming back: set PYTHONDONTWRITEBYTECODE=1 where the test runs the helper, and/or add __pycache__/ and *.pyc to .gitignore. It doesn't reach the image, because the Dockerfile copies only the .py file.

@propr-dev

propr-dev Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 60b57b3

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk (1 file)
    • scripts/__pycache__/opencode-credentials.cpython-311.pyc (deleted, +0/−0): auth-looking path
  • Normal risk (1 file)
    • .gitignore (+4/−0)
  • Low risk (1 file)
    • test/opencodeCredentials.test.ts (+11/−3)

Diff size: 3 files changed, +15/−3 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 5m 11s
  • Tokens: 367,933 (366,018 in / 1,915 out)
  • Cost: $0.32

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7218334791✓

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
@propr-dev

propr-dev Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Finalize unsigned validation checksums

Please investigate and fix this CI failure.

  • Check: Finalize unsigned validation checksums
  • Result: failure
  • Commit: 60b57b39243c (60b57b39243c0f3e91ec2855565c3262118b7e38)
  • Run: View CI failure

Failure evidence

No failure output was provided by the CI service.

@propr-dev

propr-dev Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

ℹ️ Analyzed the follow-up request by @propr-dev[bot]

Analysis Summary

I 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. Finalize unsigned validation checksums then failed after about 25 seconds, at the "Install cross-format inspection tools" step, on sudo apt-get update:

Err:6 https://packages.microsoft.com/ubuntu/24.04/prod noble InRelease
E: Failed to fetch https://packages.microsoft.com/ubuntu/24.04/prod/dists/noble/InRelease  403  Forbidden [IP: 13.107.246.40 443]
E: The repository 'https://packages.microsoft.com/ubuntu/24.04/prod noble InRelease' is no longer signed.
##[error]Process completed with exit code 100.

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:

  • In attempt 2 of the same run, the same install step passed and the artifacts downloaded. That attempt was then cancelled during the checksum check, so it doesn't count as a pass or a failure.
  • The same finalize job passed in another PR's run (46000012476) a few minutes before.
  • The previous run on this branch (45991763504) passed, and desktop-release-guard.yml isn't changed on this branch or on main.

Next step: rerun the Desktop Release Guard workflow for commit 60b57b39.

I didn't harden the workflow, for example by removing the Microsoft source or tolerating apt-get update errors from other package sources. The same apt-get update runs in about 15 places across the desktop workflows, and changing them is outside this OpenCode PR. If these 403s keep happening, that would be a separate CI change.

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

  • Model: Claude Opus 5.5 (medium)
  • Time: 5m 2s
  • Tokens: 679,338 (675,488 in / 3,850 out)
  • Cost: $0.45
  • Subscription usage: Weekly +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7218792088✓

@propr-dev propr-dev Bot changed the title 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 ⚠️❻ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@integry
integry marked this pull request as ready for review November 27, 2026 13:52
@propr-dev

propr-dev Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from main into goal-9ed2d2e8/gpt-6.2-astra-upgrade-opencode-to-next--20261126-1141-vbb in commit 63af26a

Conflicting Files

  • Dockerfile.agent
  • packages/core/src/agents/version/types.ts
  • scripts/build-images.sh

Resolution Summary

I 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 /opt/opencode), and main upgrades Vibe from 2.25.8 to 3.1.5. So each side's own change was kept and nothing had to be traded off.

1. Dockerfile.agent, the step that creates the CLI commands

  • Conflict: the PR replaced OpenCode's command setup with a link to /opt/opencode/bin/opencode. main kept its old OpenCode line (link_npm_bin opencode-ai opencode) and added a new link to Vibe's install location, /opt/uv/tools/mistral-vibe/bin/vibe.
  • Resolution: I kept the PR's OpenCode link and added main's Vibe link. I dropped main's opencode-ai line, because the PR's build no longer installs OpenCode where that line expects it.
  • Why the Vibe link is needed: main also removed the step that copied the Vibe program from its build stage, and the merged file already follows main there. Without the new link, no vibe command would exist and the vibe --version check later in the build would fail.

2. Dockerfile.agent, the version settings in the final image

  • Conflict: the PR set OpenCode 2.4.2 / Vibe 2.25.8; main set OpenCode 1.19.6 / Vibe 3.1.5.
  • Resolution: OpenCode 2.4.2 (the PR's purpose) and Vibe 3.1.5 (main's purpose). These now match the earlier build stages in the same file, which already had 2.4.2 and 3.1.5.

3. packages/core/src/agents/version/types.ts (default versions per agent)

  • Same conflict, same resolution: opencode: '2.4.2', vibe: '3.1.5'. The Vibe 3.1.5 support code that came in from main (the new parser and usage files) expects this version.

4. scripts/build-images.sh

  • Same conflict, same resolution: OpenCode 2.4.2 and Vibe 3.1.5. These defaults are meant to match the Dockerfile, and now they do.

Checks

  • bash -n scripts/build-images.sh passes.
  • The five test files that check version pins (agentBundleContentFiles, agentRegistryManagedAgentPin, agentVersionManagement, modelDefinitions, configManagerAgents) all pass: 88 tests. On the first run agentRegistryManagedAgentPin failed before any test ran, because it needs Node's --experimental-test-module-mocks flag. With the flag, its 9 tests pass.
  • I did not build the Docker image, so the new link setup has not been run for real. The only check on it so far is that the paths match what the build stages install.

Some 2.25.8 references remain in modelDefinitions.ts and a few tests. Those came from main and record the oldest Vibe version each model works with, so I left them alone.


🤖 Resolution Details

  • Model: Claude Opus 5.5
  • Time: 2m 54s

View Task Execution


System-triggered merge conflict resolution

@propr-dev propr-dev Bot changed the title ⚠️❻ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
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
@integry

integry commented Nov 27, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 node, avoiding root-owned runtime logs.

✅ 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F3: 🔴 Empty modern stores resurrect legacy credentials

  • Category: security

  • Required behavior: A disposable task must respect the authoritative host credential store, including removal of its final credential.

  • Evidence: scripts/opencode-credentials.py:seed — the if rows branch determines whether the host database is authoritative.

    1. An OpenCode 2 host has database credentials and a stale legacy auth.json, a configuration explicitly represented by withDatabaseHost in test/opencodeCredentials.test.ts.
    2. The host removes its final database credential before the next task, leaving the legacy file present.
    3. scripts/opencode-entrypoint.sh initializes the fresh disposable database with opencode auth list --standalone, importing that legacy file.
    4. seed sees zero host rows, classifies the host as OpenCode 1.x, and retains the imported credentials. The task consequently receives credentials the authoritative host store no longer contains.

    The conditional update in sync protects deletions during a run, but cannot protect this deletion before seeding. Existing tests cover an empty legacy database and deletion during a task, not an emptied modern database. static trace: the supplied initialization sequence, seed branches, and database-host fixture establish this behavior; no commands were executed. This concerns local credential removal, without assuming the provider has also invalidated the token.

  • Minimum fix: Distinguish an initialized OpenCode 2 store from a legacy store using durable format or migration evidence rather than row count alone. For an empty modern store, clear imported runtime credentials. Preserve legacy empty-table support and add a regression covering removal of the final modern credential with stale auth.json present.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Update credential migration documentation

docs/docs/architecture/agent-runtime.md still says an empty host credential table receives imported rows and leaves auth.json unchanged. The helper now preserves the empty table and writes refreshes to JSON. Updating this paragraph would make operational guidance match the implementation; it does not affect runtime correctness.

S4: 🟢 Use an explicit bytecode flag

test/opencodeCredentials.test.ts passes -I, which ignores PYTHON* environment variables, including PYTHONDONTWRITEBYTECODE. Adding -B would express the intended suppression reliably. This is optional because the ignore rules already prevent accidental inclusion, and the shown runpy.run_path invocation does not itself establish that helper bytecode will be generated.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 51s
  • Tokens: 73,041 (71,940 in / 1,101 out)
  • Cost: $0.65

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F3 S3 S4

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 ⚠️❻ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@integry

integry commented Nov 27, 2026

Copy link
Copy Markdown
Owner

I checked F3 against the real CLIs, and it's confirmed.

OpenCode 2.4.2's auth logout never touches auth.json. I took a copy of a real 1.x host and let 2.4.2 initialize it, which imports auth.json. Then I ran opencode auth logout <integration> <credential> for every credential. Afterwards the host credential table had 0 rows and opencode auth list was empty, but auth.json still held both entries (openrouter, openai). The host stays logged out. ProPR's fresh disposable DB imports auth.json again, seed sees 0 host rows and treats the host as 1.x, and the task gets credentials the user removed. Partial logouts are fine; only removing the last credential triggers this.

Telling the formats apart: use the schema, not the row count. A DB created by 1.19.6 has data_migration and none of the 2.x tables. After 2.4.2 initializes the same DB, it has 2.x-only tables: session_v2, machine, kv, job, automation, blob, instruction_*, worktree. data_migration is gone, and the migration table has 64 rows, up to 20261120004954_machine-key. Suggested rule:

  • Host DB has a credential table and a 2.x-only table (for example session_v2, or check several such as session_v2/machine): it's a 2.x store, authoritative even when empty. In seed, DELETE FROM credential in the runtime DB before inserting the host rows (none in this case), so nothing imported from auth.json survives. Use the DB sync path, and never write auth.json.
  • Otherwise (no DB, no credential table, or a 1.x schema): keep the current auth.json path.

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:

  • A 2.x-schema host DB with its last credential removed plus a stale auth.json: after seed, the runtime has no credentials, and sync writes nothing to auth.json.
  • A 2.x-schema host DB with rows plus a stale auth.json: unchanged behavior (host rows only).
  • A 1.x-schema DB with an empty credential table plus auth.json: unchanged (the auth.json path). Please build this fixture with the 1.x tables (data_migration, no session_v2) instead of a bare credential table, so the test exercises the classifier.

S4 is correct, please take it too: -I implies -E, so PYTHONDONTWRITEBYTECODE in the test env is ignored. Use -B instead. In practice no __pycache__ appeared in my runs, because the helper runs as __main__/run_path, but the flag should do what the comment says. S3, the docs paragraph, is worth updating in the same commit.

@propr-dev propr-dev Bot changed the title ⚠️❻ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@propr-dev

propr-dev Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit aca04de

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk (1 file)
    • scripts/opencode-credentials.py (+29/−12): auth-looking path
  • Normal risk (1 file)
    • scripts/opencode-entrypoint.sh (+3/−2)
  • Low risk (2 files)
    • docs/docs/architecture/agent-runtime.md (+1/−1)
    • test/opencodeCredentials.test.ts (+47/−8)

Diff size: 4 files changed, +80/−23 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 5m 1s
  • Tokens: 940,192 (932,055 in / 8,137 out)
  • Cost: $0.64
  • Subscription usage: Weekly +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7220333558✓

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
@integry

integry commented Nov 27, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 auth.json credentials from being restored.

✅ 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 node, and the added image smoke test checks for root-owned disposable state.

This was a static review of the supplied code; no commands or tests were run. Current checks show zero failures and twelve pending.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S5: 🟢 Automate real CLI credential fixtures

The 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 explicitly

Add optional regression coverage for exact 1.x version resolution and the legacy task and scout flags. These compatibility branches remain in versionService.ts and openCodeUtils.ts, but the changed tests primarily exercise the new default.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 51s
  • Tokens: 74,589 (73,562 in / 1,027 out)
  • Cost: $0.68

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S5 S6

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 ✅❽ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
@integry
integry merged commit fe2c807 into main Nov 27, 2026
51 checks passed
@integry
integry deleted the goal-9ed2d2e8/gpt-6.2-astra-upgrade-opencode-to-next--20261126-1141-vbb branch November 27, 2026 17:47
@propr-dev propr-dev Bot changed the title ✅❽ [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 [Goal by GPT-6.2 Astra] Upgrade OpenCode from version 1 to 2 Nov 27, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 27, 2026
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
integry pushed a commit that referenced this pull request Nov 27, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant