openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Background completion routers: key by (workspace, storage scope)

Open senamakel opened this issue 1 month ago • 2 comments

From CodeRabbit on #7686: agent/orchestration/background_completions.rs caches entries by workspace_dir only; a caller in a second storage scope can reuse the first scope's store, and a scope-resolution failure caches the in-memory fallback. Key routers/degrade/recovery by (workspace, scope), store scope in thread_workspaces, return uncached fallback on scope errors, add two-scope tests. Part of #7522.

senamakel avatar Oct 13 '26 09:10 senamakel

Background completion routers in agent/orchestration/background_completions.rs are cached by workspace_dir only, so a caller in a second storage scope can reuse the first scope's store, and a scope-resolution failure caches the in-memory fallback. Fix is to key routers/degrade/recovery by (workspace, scope), store scope in thread_workspaces, return the uncached fallback on scope errors, and add two-scope tests.

Labelled priority: p2.

tinysweeper avatar Oct 13 '26 15:10 tinysweeper

Picking this one up. Plan is to make the cached routers remember which scope a store was opened for, carry that through the per-thread lookups so stop/delete/purge hit the right one, and stop remembering the in-memory fallback when the scope can't be worked out, with tests that run two scopes against the same workspace.

obchain avatar Oct 16 '26 07:10 obchain