Skip to content

Conversation

@imarshallwidjaja
Copy link
Contributor

@imarshallwidjaja imarshallwidjaja commented Jan 12, 2026

Summary

This PR fixes a critical issue in the sisyphus_task tool where running in synchronous mode (run_in_background=false) would frequently fail with a JSON Parse error: Unexpected EOF. It also ensures that category-specific models (e.g., for visual or business-logic) are correctly propagated to the subagent in sync mode.

Changes

Core Fixes

  • Resolved Race Condition in Sync Mode: Replaced a broken "fire-and-forget" prompt pattern in src/tools/sisyphus-task/tools.ts with a proper await on the client.session.prompt call. The previous implementation used a 100ms delay and a .catch() block that often resulted in the request being aborted or racing with session updates, causing truncated JSON responses.
  • Fixed Missing Category Model: Added logic to include the categoryModel in the prompt body when executing in sync mode. Previously, the subagent would use its default model instead of the one defined by the task's category.

Refactoring & Cleanup

  • Simplified Error Handling: Removed redundant async error checks and polling delay logic that are no longer necessary now that the prompt request is properly awaited.
  • Improved Reliability: Aligned the sync mode implementation with the stable pattern used in call_omo_agent.

Testing

bun run typecheck
bun test
  • Added Sync Mode Test Suite: Introduced a comprehensive describe block in src/tools/sisyphus-task/tools.test.ts covering:
  • Increased Test Timeouts: Adjusted timeouts to 20s for sync tests to accommodate the tool's stability polling mechanism.

Verification Results

  • Build: bun run build completes without errors.
  • Tests: bun test src/tools/sisyphus-task/tools.test.ts passes with 34 pass / 0 fail.
Thinking: The user wants me to test if the sisyphus_task sync mode issue is fixed. Let me run the test with run_in_background=false to see if it still fails.
Testing sync mode:
⚙ sisyphus_task [run_in_background=false, category=quick, description=Test sync mode fix, prompt=Say "Hello, sync mode works!" and nothing else.]
Fixed! ✅

Summary by cubic

Fixes sync mode failures in sisyphus_task by awaiting the prompt call to remove a race that caused "JSON Parse error: Unexpected EOF". Also ensures the correct category model is sent to the subagent in sync runs.

  • Bug Fixes
    • Await client.session.prompt in sync mode; remove the 100ms delay and return clearer errors (e.g., agent not found).
    • Pass categoryModel in the prompt body so the correct provider/model is used.
    • Add sync-mode tests (error/success, agent-not-found, model propagation) and increase timeouts to 20s.

Written for commit 224ddb1. Summary will update on new commits.

Replace fire-and-forget prompt pattern with try/await/catch in sync mode.
The fire-and-forget pattern with 100ms delay caused race conditions where
errors occurred after the check, leading to "JSON Parse error: Unexpected EOF".
This aligns sync mode with call_omo_agent and the resume path which already
use proper await.

fix(sisyphus_task): resolve sync mode JSON parse error

Replace fire-and-forget prompt pattern with try/await/catch in sync mode.
Also pass categoryModel to prompt body (was missing, caused ProviderModelNotFoundError).
Add tests for sync mode including model passing verification.
Copy link

@greptile-apps greptile-apps bot left a 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.

@imarshallwidjaja imarshallwidjaja changed the title fix(sisyphus_task): resolve sync mode JSON parse error fix(sisyphus_task): resolve sisyphus_task not working in sync mode Jan 12, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@code-yeongyu code-yeongyu merged commit 179f57f into code-yeongyu:dev Jan 12, 2026
3 checks passed
@imarshallwidjaja imarshallwidjaja deleted the fix/sisyphus_task-Sync-Mode-Failure branch January 13, 2026 00:04
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.

2 participants