-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(background-agent): inherit parent session directory for background tasks #731
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
fix(background-agent): inherit parent session directory for background tasks #731
Conversation
…d tasks Background tasks were defaulting to $HOME instead of the parent session's working directory. This caused background agents to scan the entire home directory instead of the project directory, leading to: - High CPU/memory load from scanning unrelated files - Permission errors on system directories - Task failures and timeouts The fix retrieves the parent session's directory before creating a new background session and passes it via the query.directory parameter. Files modified: - manager.ts: Look up parent session directory in launch() - call-omo-agent/tools.ts: Same fix for sync mode - look-at/tools.ts: Same fix for look_at tool - sisyphus-task/tools.ts: Same fix + interface update for directory prop - index.ts: Pass directory to sisyphusTask factory
|
All contributors have signed the CLA. Thank you! ✅ |
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.
No issues found across 5 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
|
I have read the CLA Document and I hereby sign the CLA |
|
The CLA check is failing due to branch protection rules preventing the CLA bot from updating Error: Could a maintainer please either:
Thank you! |
|
recheck |
|
@sisyphus-dev-ai review |
Code Review - PR #731SummaryVerdict: ✅ APPROVE with minor suggestions This PR effectively solves the problem of background tasks scanning the entire home directory by ensuring they inherit the parent session's working directory. The implementation is solid, consistent, and handles edge cases appropriately. ✅ Strengths
|
|
lgtm, thanks for the pr! |
- Add guard clause to check if client.session.get exists before calling - Update 4 sync mode tests to properly mock session.get - Fixes test failures from PR #731 directory inheritance feature
Summary
$HOMEProblem
When launching background tasks via
call_omo_agent,sisyphus_task, orlook_at:$HOMEinstead of the project directorySolution
Before creating a background session, look up the parent session's directory and pass it via
query.directory:Files Changed
src/features/background-agent/manager.ts- Core fix inlaunch()src/tools/call-omo-agent/tools.ts- Same fix for sync modesrc/tools/look-at/tools.ts- Same fix for look_at toolsrc/tools/sisyphus-task/tools.ts- Same fix + interface updatesrc/index.ts- Pass directory to sisyphusTask factoryTesting
Verified that background sessions now correctly inherit project directory:
Summary by cubic
Background tasks now use the parent session’s working directory instead of defaulting to $HOME. This prevents scanning the entire home directory, cutting CPU/memory spikes and avoiding task failures.
Written for commit 9e98cef. Summary will update on new commits.