Skip to content

Route GitHub work item queries through active runtime environment#5000

Merged
AmethystLiang merged 1 commit into
mainfrom
https-github.com-stablyai-orca-issues-4635-2
Jun 9, 2026
Merged

Route GitHub work item queries through active runtime environment#5000
AmethystLiang merged 1 commit into
mainfrom
https-github.com-stablyai-orca-issues-4635-2

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Routes GitHub work item fetches and counts through the active runtime environment when available, with appropriate fallback and concurrency handling.

Changes

  • Runtime Routing: Routes listWorkItems and countWorkItems requests through the active runtime environment if the repository is registered in that environment.
  • Local Fallback: Falls back to local IPC (window.api.gh) if no runtime is active or if the requested repo path is missing from the active environment.
  • Switch Concurrency Handling: Scopes inflight work-item requests by target environment and repo ID. Discards cache writes if the active runtime environment switches while a request is in flight to avoid stale cache states.
  • Test Coverage: Adds comprehensive test cases in github.test.ts covering routing, local fallback, count queries, pagination, and runtime-switching race conditions.

Fixes #4635

- Use the active runtime environment RPC for fetching, paging, and
  counting work items when available, falling back to local IPC.
- Scope in-flight work item request keys to specific environment targets
  to avoid incorrect deduplication during runtime transitions.
- Discard and skip writing work item responses to cache if the active
  runtime environment changed while the request was in flight.
@AmethystLiang AmethystLiang merged commit 3411a75 into main Jun 9, 2026
2 checks passed
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.

[Bug]: Tasks work items fail on remote (paired) runtime — client calls local gh:listWorkItems instead of forwarding to the runtime

1 participant