Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized OpenCode usage-reading fix that resolves each configured instance’s data directory and deduplicates aliases, with focused regression tests and no schema, deployment, default-setting, or diagnostic-suppression changes. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Addressed the new diagnostic-suppression concern in d2990e8 by reusing the existing junction fixture in UsageService.test.ts. The cumulative PR now adds no diagnostic suppression or native filesystem import. That fixture directly calls the public OpenCode usage reader with two instance environments and asserts one canonical scanner source before aggregation. Disabling only cross-instance root deduplication makes this assertion fail (two sources instead of one), so service-level record deduplication cannot hide duplicate scans. The distinct-root and default regressions remain in the provider tests. Production behavior is unchanged from the previous head. Independently reran the final focused suites: 33/33 tests pass. Both affected-package typechecks and three-file lint/format pass. Updated the PR body and linked issue evidence to this final coverage. A scoped independent code re-review found the suppression concern addressed and no new findings. |
|
@macroscope-app please re-run the approvability check on the current head (d2990e8). The "Not approved" verdict above was posted at 07:54 UTC for 72458d8, before d2990e8 moved the alias regression onto the existing junction fixture in |
|
Sorry, I'm unable to act on this request because you do not have permissions within this repository. |
d2990e8 to
2aea70d
Compare
Problem
OpenCode usage scans received configured provider instances but resolved data directories from the host environment once. History from instances with their own
OPENCODE_DATA_DIRorXDG_DATA_HOMEwas omitted.Change
Resolve roots from each instance's already merged environment, then deduplicate canonical paths across all instances before scanning. Preserve the existing comma-separated override precedence, home expansion, XDG fallback, and history reader.
Fixes #17631.
Scope and approval
#17631 was filed by maintainer Julius and specifies per-instance root resolution, canonical deduplication, and a two-instance regression test. This PR implements that scope in the OpenCode scanner and focused provider/service usage tests. The portable alias regression extends the existing service-test junction fixture; it adds no diagnostic suppression.
Verification
macOS, Node 24.21.0; synthetic temporary SQLite stores, no live provider history.
XDG_DATA_HOMEdefault cases pass. The existing SQLite/WAL and legacy migration test passes.node node_modules/vite-plus/bin/vp test run packages/provider-opencode/src/server/usage.test.ts apps/server/src/usage/UsageService.test.ts— 33 tests passed across two files, independently rerun after commit.node node_modules/typescript/bin/tsc --noEmit -p packages/provider-opencode/tsconfig.jsonandnode node_modules/typescript/bin/tsc --noEmit -p apps/server/tsconfig.json— exit 0; existing Effect suggestions elsewhere, no errors.node node_modules/vite-plus/bin/vp lint packages/provider-opencode/src/server/usage.ts packages/provider-opencode/src/server/usage.test.ts apps/server/src/usage/UsageService.test.tsand the equivalentvp fmt --check— passed.git diff --checkpassed.The local Vite+ entry point was invoked with Node 24 directly because the global installation wrapper selected a different runtime. Windows was not executed; the alias fixture uses a directory junction for Windows compatibility.
Implemented with GPT-6.1-Sol through Codex desktop; reviewed independently through Codex.