Repository navigation
fix(server): add error logging to catch {} in MCP server.zig message processing #189
Description
Activity
github-actions commented
on Mar 11, 2026 on Mar 11, 2026 – with GitHub ActionsContributorMore actions🚀 Agent container spawned! Deploying on Railway. Tracking in this issue.
github-actions commented
on Mar 11, 2026 on Mar 11, 2026 – with GitHub ActionsContributorMore actions🚀 Agent container spawned! Deploying on Railway. Tracking in this issue.
🌅 Trinity Agent | 2026-03-11T19:30:38Z
📋 Step: 1/8 — Authenticating with GitHub
🔄 Status: AWAKENING
⏱️ Elapsed: 0s🌅 Trinity Agent Dashboard — Issue #189
Field Value Status AWAKENING Step 1/8 Detail Authenticating with GitHub Elapsed 0s Container agent-189 Updated 2026-03-11T19:30:38Z 🌅 Trinity Agent Dashboard — Issue #189
Field Value Status AWAKENING Step 2/8 Detail Creating worktree from bare repository Elapsed 3s Container agent-189 Updated 2026-03-11T19:30:41Z ☠️ Trinity Agent | 2026-03-11T19:30:46Z
📋 Step: 3/8 — Container terminated by signal
🔄 Status: KILLED
⏱️ Elapsed: 8s☠️ Trinity Agent Dashboard — Issue #189
Field Value Status KILLED Step 3/8 Detail Container terminated by signal Elapsed 8s Container agent-189 Updated 2026-03-11T19:30:46Z 🌅 Trinity Agent | 2026-03-11T19:30:52Z
📋 Step: 1/8 — Authenticating with GitHub
🔄 Status: AWAKENING
⏱️ Elapsed: 0s🌅 Trinity Agent Dashboard — Issue #189
Field Value Status AWAKENING Step 1/8 Detail Authenticating with GitHub Elapsed 0s Container agent-189 Updated 2026-03-11T19:30:52Z ☠️ Trinity Agent | 2026-03-11T19:30:54Z
📋 Step: 2/8 — Container terminated by signal
🔄 Status: KILLED
⏱️ Elapsed: 2s☠️ Trinity Agent Dashboard — Issue #189
Field Value Status KILLED Step 2/8 Detail Container terminated by signal Elapsed 2s Container agent-189 Updated 2026-03-11T19:30:54Z 🌅 Trinity Agent | 2026-03-11T19:30:58Z
📋 Step: 1/8 — Authenticating with GitHub
🔄 Status: AWAKENING
⏱️ Elapsed: 0s🌅 Trinity Agent Dashboard — Issue #189
Field Value Status AWAKENING Step 1/8 Detail Authenticating with GitHub Elapsed 0s Container agent-189 Updated 2026-03-11T19:30:58Z ☠️ Trinity Agent | 2026-03-11T19:31:01Z
📋 Step: 2/8 — Container terminated by signal
🔄 Status: KILLED
⏱️ Elapsed: 3s1 remaining item
🌅 Trinity Agent | 2026-03-11T19:31:06Z
📋 Step: 1/8 — Authenticating with GitHub
🔄 Status: AWAKENING
⏱️ Elapsed: 0s🌅 Trinity Agent Dashboard — Issue #189
Field Value Status AWAKENING Step 1/8 Detail Authenticating with GitHub Elapsed 0s Container agent-189 Updated 2026-03-11T19:31:06Z 🌅 Trinity Agent Dashboard — Issue #189
Field Value Status AWAKENING Step 2/8 Detail Creating worktree from bare repository Elapsed 4s Container agent-189 Updated 2026-03-11T19:31:10Z ✅ Trinity Agent Dashboard — Issue #189
Field Value Status DONE Step 8/8 Detail PR created with 1 commits Elapsed 255s Container agent-189 Updated 2026-03-11T19:35:21Z ⚡ Trinity Agent | 2026-03-11T19:31:18Z
📋 Step: 4/8 — Claude Code running (timeout: 3600s)
🔄 Status: CODING
⏱️ Elapsed: 12s- added a commit that references this issue
on Mar 11, 2026 🔧 Agent: Claude | 2026-03-11
📋 Step: 1/1 — Implement error logging fix
🔄 Status: DONEThought: Silent
catch {}blocks were dropping MCP message processing errors with no visibility for debugging.Action:
- Added comment to stderr startup writes (lines 1167-1168) documenting them as best-effort
- Added
std.log.errlogging for bothprocessMessagecalls (lines 1198, 1246)
Result:
- ✅
zig fmt --checkpasses - ✅
zig ast-checkpasses - ✅ PR fix(server): add error logging to MCP message processing #191 created and ready for review
Next: Merge PR, issue auto-closes
💥 Trinity Agent | 2026-03-11T19:35:00Z
📋 Step: 5/8 — 2. Lines 1198-1200 - Added error logging for raw JSON message processing:
🔄 Status: ERROR
⏱️ Elapsed: 234s🔄 Trinity Agent | 2026-03-11T19:35:09Z
📋 Step: 5/8 — Self-review (advisory)
🔄 Status: REVIEWING
⏱️ Elapsed: 243s🧪 Trinity Agent | 2026-03-11T19:35:14Z
📋 Step: 6/8 — Checking/creating PR
🔄 Status: TESTING
⏱️ Elapsed: 248s🚀 Trinity Agent | 2026-03-11T19:35:18Z
📋 Step: 7/8 — PR #191 already exists
🔄 Status: PR_CREATED
⏱️ Elapsed: 252s✅ Trinity Agent | 2026-03-11T19:35:21Z
📋 Step: 8/8 — PR created with 1 commits
🔄 Status: DONE
⏱️ Elapsed: 255s- added a commit that references this issue
on Mar 18, 2026
Task
In
tools/mcp/trinity_mcp/server.zig, critical message processing errors are silently swallowed:_ = posix.write(stderr_fd, "TRINITY MCP Server v2.0.0 started\n") catch {};_ = posix.write(stderr_fd, "38+ tools + resources + prompts | Content-Length framing\n\n") catch {};processMessage(&server, line, &stdout_writer, allocator) catch {};processMessage(&server, body, &stdout_writer, allocator) catch {};Lines 1226 and 1272 are especially critical — silently dropping MCP messages means tools fail with no indication why.
Fix
For startup messages (1195-1196), these are non-critical — add a comment:
For message processing (1226, 1272), log the error:
File
tools/mcp/trinity_mcp/server.zig— lines 1195, 1196, 1226, 1272Acceptance
zig buildcompiles without errorszig fmtpasses