Skip to content

fix: platform tech debt — server, MCP, SDK quick wins#110

Open
gilbert-barajas wants to merge 1 commit into
masterfrom
fix/macbook-claude/platform-tech-debt
Open

fix: platform tech debt — server, MCP, SDK quick wins#110
gilbert-barajas wants to merge 1 commit into
masterfrom
fix/macbook-claude/platform-tech-debt

Conversation

@gilbert-barajas
Copy link
Copy Markdown
Collaborator

Summary

  • Server: Wrap deleteAgent() in transaction, fix N+1 query in calibration loop, add logging to silent catch
  • MCP: Convert 4 tools from raw JSON to Zod schema, log config errors instead of swallowing
  • SDK: Adaptive heartbeat (5min idle / 90s active), env var support for runtime metadata
  • Watchdog: Fix onWork unclaim, embed claim flow, callback_path prefix, transient error handling, QA workingOn pollution, remove WS monitoring

Test plan

  • Server starts without errors
  • MCP tools (request_work, file_directive, upload_asset, download_asset) accept params correctly
  • SDK agent heartbeats at 5min when idle, 90s when working
  • Watchdog QA tests pass without polluting agent.workingOn
  • Embed jobs process correctly with new claim flow

🤖 Generated with Claude Code

Server:
- Wrap deleteAgent() in transaction (9 table deletes were non-atomic)
- Fix N+1 query: move getAllTeamSettingsGrouped() outside loop in calibration
- Add logging to silent catch in sleep_mode_log parse

MCP:
- Convert 4 tools from raw JSON schema to Zod (request_work, file_directive, upload_asset, download_asset)
- Log config errors in api.js instead of silent catch

SDK:
- Adaptive heartbeat: 5min idle / 90s active (matches MCP behavior)
- Add env var support for runtime metadata (MYCELIUM_RUNTIME, LLM_BACKEND, LLM_MODEL, CAPABILITIES)

Watchdog:
- Override onWork to unclaim items (fixes idle handler never firing)
- Fix embed callback_path double URL prefix
- Fix embed claim flow (use PUT status instead of POST /drones/claim)
- Filter embed jobs by job_type or title prefix (handles retried jobs)
- QA: skip bug filing for transient auth/network errors
- QA: wrap context delete in try/catch (admin-only endpoint)
- QA: use raw API for task/bug lifecycle (avoids workingOn pollution)
- QA: remove extra heartbeat from testSavepoints
- Remove willing-sacrifice from uptime monitoring (not hosted)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant