Skip to content

fix: allow concurrent subagents and sessions in same workdir - #17

Merged
matdev83 merged 1 commit into
mainfrom
fix/subagent-workdir-concurrency
Aug 16, 2026
Merged

fix: allow concurrent subagents and sessions in same workdir#17
matdev83 merged 1 commit into
mainfrom
fix/subagent-workdir-concurrency

Conversation

@matdev83

Copy link
Copy Markdown
Owner

Summary

Remove the exclusive repository coordinator file lock from AgyAgent.Prompt() to prevent deadlocks when a parent agent spawns subagents in the same workspace directory.

Root Cause

AgyAgent.Prompt() held an exclusive file lock ( lock on �gy-workdir-.lock) for the entire duration of each prompt turn. When a parent agent running in workspace W spawned a subagent targeting �gy-cli-acp in workspace W, the subagent blocked waiting for the file lock while the parent agent was blocked waiting for the subagent's response.

Fix

  • Remove �.coordinator.Lock around Prompt(). Prompt files and context dumps already use unique per-instance/per-session directories (.go-agy-acp-wrapper///...), and AGY natively tracks conversation IDs per stream/session.
  • Add TestAgyAgent_ConcurrentPromptsInSameWorkdir to verify multiple sessions can execute prompts concurrently in the same directory without blocking.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: caad41da-d2df-4c12-835f-4c953c808367


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@matdev83
matdev83 merged commit f3d44c9 into main Aug 16, 2026
12 checks passed
@matdev83
matdev83 deleted the fix/subagent-workdir-concurrency branch August 16, 2026 22:26
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