Skip to content

fix: wire goalSessionStore in MCP transports, normalize error formats#252

Merged
windoliver merged 1 commit intomainfrom
fix/214-goal-session-store-error-format
Apr 14, 2026
Merged

fix: wire goalSessionStore in MCP transports, normalize error formats#252
windoliver merged 1 commit intomainfrom
fix/214-goal-session-store-error-format

Conversation

@windoliver
Copy link
Copy Markdown
Owner

Summary

Closes #214.

  • Wire goalSessionStore into both stdio MCP (serve.ts) and HTTP MCP (serve-http.ts) deps — fixes grove_goal, grove_set_goal, grove_list_sessions, grove_create_session silently returning [NOT_CONFIGURED] on the two most common agent transports
  • Export toolError() from error-handler.ts as the single canonical error formatter
  • Fix toolValidationError() format from VALIDATION_ERROR: msg (colon) to [VALIDATION_ERROR] msg (brackets) matching all other error paths
  • Refactor inline error objects in goal.ts, session.ts, handoffs.ts, ingest.ts to use shared toolError() — removes ~70 lines of duplicated boilerplate
  • Normalize HTTP errors in serve-http.ts from plain strings ("Internal server error") to structured { error: { code, message } } via new httpError() helper — matches the SESSION_NOT_READY pattern already in use
  • Add deps parity test (deps-parity.test.ts) to catch future store wiring omissions

Test plan

  • 122 existing MCP tests pass (0 failures)
  • New deps-parity.test.ts passes (3 tests)
  • TypeScript strict mode — zero type errors
  • Biome lint — zero warnings on all changed files

…#214)

goalSessionStore was initialized by createLocalRuntime but never passed
into the McpDeps object in either stdio or HTTP MCP entry points, causing
all four goal/session tools to silently return [NOT_CONFIGURED] on the
primary agent transport.

Also normalizes error formats: toolValidationError() now uses [CODE]
bracket format matching error-handler.ts, inline error objects across
tool files refactored to shared toolError(), and HTTP-level errors in
serve-http.ts normalized to { code, message } via httpError() helper.
@windoliver windoliver force-pushed the fix/214-goal-session-store-error-format branch from 7213a74 to a16b9bd Compare April 14, 2026 22:34
@windoliver windoliver merged commit 8cf9596 into main Apr 14, 2026
1 check passed
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.

DX: fix goalSessionStore not wired in stdio MCP, normalize error formats

1 participant