Repository navigation
fix(opencode): wait for a cold directory's scan before caching its skills #31074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b226bb5
878bef4
4be38a2
1c3eaa0
d4a2758
d590be7
d062c5d
bbfce40
15cca99
4aba0c7
378c016
053a74f
2b44d8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -527,15 +527,20 @@ export interface OpenCode2Workspace { | |
| } | ||
|
|
||
| /** | ||
| * A server scans a directory it has not served yet in the background: its first read lists | ||
| * no commands at all (not even the built-ins), and `command.updated` plus `skill.updated` | ||
| * for the directory end the scan. `scanned` must be listening before `read` runs, since | ||
| * the read is what starts the scan. | ||
| * Reading a location the server has not loaded boots its scan, and only reads after the scan's | ||
| * `command.updated` plus `skill.updated` are complete; `scanned` must listen before `read`. A | ||
| * loaded location listing no commands is still scanning. OpenCode exposes no readiness signal, | ||
| * so one another caller booted moments earlier can still read partial. | ||
| */ | ||
| export const loadOpenCode2Workspace = Effect.fn("OpencodeProviderStatus.loadOpenCode2Workspace")( | ||
| function* <E>(read: Effect.Effect<OpenCode2Workspace, E>, scanned: Effect.Effect<void>) { | ||
| function* <E>( | ||
| read: Effect.Effect<OpenCode2Workspace, E>, | ||
| scanned: Effect.Effect<void>, | ||
| loaded: Effect.Effect<boolean>, | ||
| ) { | ||
| const wasLoaded = yield* loaded; | ||
| const first = yield* read; | ||
| if (first.commands.length > 0) return first; | ||
| if (wasLoaded && first.commands.length > 0) return first; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle an unavailable event stream within the timeout budget. If the event subscription times out, On subscription or stream failure, use a bounded reread or retry path that fits within the outer deadline.
|
||
| yield* scanned.pipe(Effect.timeoutOption("10 seconds")); | ||
| return yield* read; | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: pingdotgg/t3code
Length of output: 46516
Script executed:
Repository: pingdotgg/t3code
Length of output: 35132
Web query:
OpenCode 2.0.28 @opencode schema AbsolutePath location directory server source githubResult:
Script executed:
Repository: pingdotgg/t3code
Length of output: 7842
Script executed:
Repository: pingdotgg/t3code
Length of output: 8430
Script executed:
Repository: pingdotgg/t3code
Length of output: 21568
Script executed:
Repository: pingdotgg/t3code
Length of output: 13886
Script executed:
Repository: pingdotgg/t3code
Length of output: 22505
Script executed:
Repository: pingdotgg/t3code
Length of output: 28931
Script executed:
Repository: pingdotgg/t3code
Length of output: 12108
Script executed:
Repository: pingdotgg/t3code
Length of output: 8473
Script executed:
Repository: pingdotgg/t3code
Length of output: 23578
Script executed:
Repository: pingdotgg/t3code
Length of output: 16064
Script executed:
Repository: pingdotgg/t3code
Length of output: 14394
Script executed:
Repository: pingdotgg/t3code
Length of output: 841
Script executed:
Repository: pingdotgg/t3code
Length of output: 6594
Keep session and inventory location identities consistent.
For a worktree path such as
/work/, the inventory uses/work, but the session uses/work/. OpenCode 2.0.28 keeps separate POSIX location registries, so a command shown in the picker may be sent as a normal prompt instead of executed.Use the same location identity for inventory and session lookups, including existing sessions.