Skip to content

fix: use exact session IDs for OpenCode lookup - #164

Closed
MoonCaves wants to merge 1 commit into
mainfrom
fix/opencode-exact-lookup-tick1245
Closed

MoonCaves wants to merge 1 commit into
mainfrom
fix/opencode-exact-lookup-tick1245

Conversation

@MoonCaves

@MoonCaves MoonCaves commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Registered OpenCode lookups can return a different session when its ID shares the requested prefix, even when the exact session exists. Registration.Lookup promises a full session ID. Use equality in both supported table queries, preserving the existing singular-to-plural error fallback and container metadata.

Regression tests exercise the actual SQLite adapter for both schemas, literal wildcard characters, prefix-only misses, exact matches hidden behind earlier rows, child metadata, and both fallback paths. The new tests fail on unchanged production in an independent checkout.

Validation:

  • Focused adapter tests with the race detector, independently rerun.
  • Go 1.24 full repository race suite, pure Go build and vet; lint reports zero issues. The local race run used GNU nohup on PATH for the existing detached-hook tests in this macOS execution environment; no hook or test code was changed.
  • Source-citation review is pending while unnecessary test scaffolding is narrowed.

This PR remains draft until the revised tests, source citations and CI are verified.

Use exact equality for both supported table names, preserving the existing singular-to-plural error fallback and container metadata. Regressions cover longer prefix rows, literal wildcard characters, missing exact IDs, child metadata, and both fallback error paths.

Prior-Art: MoonCaves/rawclaw internal/source/hermes/hermes.go L86-L90 (MIT) @e0420b85a30f2b4f562d72e531bcab64f23b6aa9 -> internal/source/opencode/opencode.go

Prior-Art: MoonCaves/rawclaw internal/source/source.go L60-L61 (MIT) @e0420b85a30f2b4f562d72e531bcab64f23b6aa9 -> internal/source/opencode/opencode_test.go

Prior-Art: MoonCaves/rawclaw internal/source/opencode/opencode_test.go L32-L136 (MIT) @e0420b85a30f2b4f562d72e531bcab64f23b6aa9 -> internal/source/opencode/opencode_test.go
@MoonCaves

Copy link
Copy Markdown
Owner Author

Closing superseded draft: exact registered full-ID lookup for OpenCode shipped on main in PR #166 (9dba68b).

@MoonCaves MoonCaves closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant