-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(prometheus): prevent agent fallback to build in background tasks #695
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(prometheus): prevent agent fallback to build in background tasks #695
Conversation
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.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
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 8 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
- Created findFirstMessageWithAgent() to read original session agent from oldest message - Updated parentAgent resolution in sisyphus_task, call_omo_agent, background_task - Fixed message.updated handler to only track agent from user messages (not assistant/system) - Added debug logging for parentAgent resolution troubleshooting Fixes issue where Prometheus agent would switch to Build when background task notifications were injected, caused by OpenCode writing 'agent: build' to message files mid-session.
9ba9b6c to
1f915aa
Compare
|
@sisyphus-dev-ai review this ulw |
|
@sisyphus-dev-ai hey review this ulw |
|
@sisyphus-dev-ai hey if you dont ultrawork review this i am goijg to vibe merge |
|
@sisyphus-dev-ai hi this is test |
|
👋 Hi @code-yeongyu! Test received and confirmed! ✅ The sisyphus-agent CI integration is working correctly. I can see and respond to mentions in PRs. For reference (since you asked for reviews earlier): This PR has been MERGED and looks good! It fixes the Prometheus → Build agent fallback issue by:
The fix ensures Prometheus sessions remain as Prometheus even when background task notifications are injected. Let me know if you need anything else! 🚀 |
Summary
Fixes the issue where Prometheus Planner Agent falls back to Build agent mid-session when background task notifications are injected.
Root Cause
When Prometheus spawns background tasks via
sisyphus_taskorcall_omo_agent, theparentAgentfield was being read from message files that OpenCode had already written withagent: "build". This caused background task completion notifications to be sent withagent: "build", switching the session agent.Changes
1. Created
findFirstMessageWithAgent()2. Fixed parentAgent resolution in 3 tools
sisyphus_task/tools.ts: Updated to usefindFirstMessageWithAgentcall_omo_agent/tools.ts: Added full parentAgent resolution (was missing entirely)background_task/tools.ts: Updated to usefindFirstMessageWithAgent3. Fixed
message.updatedevent handler4. Updated
prometheus-md-onlyhookfindFirstMessageWithAgentfor consistencyPriority Chain
```typescript
const parentAgent = ctx.agent ?? sessionAgent ?? firstMessageAgent ?? prevMessage?.agent
```
Testing
Related Issues
Fixes the Prometheus → Build fallback bug discussed in development sessions.
Summary by cubic
Prevents Prometheus sessions from switching to Build when background task notifications are injected. Background tasks now inherit the original session agent consistently.
Written for commit 1f915aa. Summary will update on new commits.