-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Summary
Workspace isolation is not being properly initialized when running in Slack socket mode, even when workspace.enabled: true is configured. This causes:
- Git checkouts to happen in
.visor/worktrees/but NOT be added to the workspace - AI provider (ProbeAgent) to only have access to the Visor repo directory, not the checkout paths
- AI searches to fail finding code in checked-out repositories
Root Cause
There are two issues:
1. resumeFromSnapshot() doesn't call initializeWorkspace()
In src/state-machine-execution-engine.ts, the resumeFromSnapshot() function (line ~1049) creates a new context via buildEngineContextForRun() but never calls initializeWorkspace(context).
When Slack socket runner resumes from a snapshot (src/slack/socket-runner.ts line 320-336), it uses resumeFromSnapshot() which skips workspace initialization entirely.
2. Potential issue with cold runs
Even for cold runs where executeChecks() → executeGroupedChecks() → initializeWorkspace() should be called, workspace is not being initialized. This needs further investigation.
Evidence from logs
[GitCheckout] _parentContext exists: true
[GitCheckout] workspace exists: false
[GitCheckout] Workspace not enabled, skipping addProject
And from AI provider:
[DEBUG] 🗂 ProbeAgent workspace config:
[DEBUG] path (cwd): /home/buger/projects/visor2
[DEBUG] allowedFolders[0]: /home/buger/projects/visor2
The workspace is clearly not initialized despite workspace.enabled: true in config:
workspace:
enabled: true
cleanup_on_exit: trueImpact
- Git checkouts succeed (to
.visor/worktrees/worktrees/TykTechnologies-tyk-HEAD-...) - But
workspace.addProject()is never called - AI provider falls back to using only the Visor repo directory
- AI cannot search/find code in the checked-out repositories
Proposed Fix
- Add
initializeWorkspace(context)call toresumeFromSnapshot()after context creation - Investigate why cold runs also don't initialize workspace
- Add workspace initialization to any code path that creates a new EngineContext
Related Files
src/state-machine-execution-engine.ts:executeGroupedChecks()(line ~276-278),resumeFromSnapshot()(line ~1049)src/state-machine/context/build-engine-context.ts:initializeWorkspace()src/slack/socket-runner.ts: Slack message handlingsrc/providers/git-checkout-provider.ts: Workspace integrationsrc/providers/ai-check-provider.ts: Workspace detection for ProbeAgent