Skip to content

Conversation

@cdnsteve
Copy link
Collaborator

@cdnsteve cdnsteve commented Jan 7, 2026

Summary

Fixes #33

  • Add MCP server configuration logging to AgentSDKExecutor for debugging
  • Check result.success before marking tasks complete in SugarLoop
  • Default success to False (fail-safe) if field is missing
  • Tasks with success=False now properly marked as failed
  • Add MCP server config example to template config

Root Cause Analysis

The issue reported that tasks were being marked complete prematurely. Investigation found:

  1. MCP passthrough exists and works - Config path sugar.claude.mcp_serversAgentSDKExecutorSugarAgentClaudeAgentOptions is correct
  2. No visibility - No logging indicated whether MCP servers were loaded
  3. Premature completion - complete_work() was called unconditionally without checking execution result

Test plan

  • Unit tests pass (614 tests)
  • New test added for result-based failure handling
  • Code review verified all execution paths set success field correctly
  • Manual test with MCP servers configured to verify logging

Note

This is a partial fix. It adds observability and safety, but the root cause (agent creates files but doesn't execute tests) also requires users to:

  1. Configure MCP servers in their config
  2. Use prompts that explicitly require test execution

…tion

Fixes #33

Changes:
- Add MCP server configuration logging to AgentSDKExecutor for debugging
- Check result.success before marking tasks complete in SugarLoop
- Default success to False (fail-safe) if field is missing
- Log warning when success field is missing from result
- Tasks with success=False now properly marked as failed
- Add MCP server config example to template config
- Add comprehensive integration test suite (13 tests):
  - MCP server logging verification
  - Success/failure flow handling
  - Missing success field detection
  - End-to-end execution tests
@cdnsteve cdnsteve force-pushed the bugfix/33-mcp-server-passthrough branch from 9989ea7 to bed4e13 Compare January 7, 2026 03:03
@cdnsteve cdnsteve merged commit ffa5d7d into develop Jan 7, 2026
14 checks passed
@cdnsteve cdnsteve mentioned this pull request Jan 7, 2026
3 tasks
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