Skip to content

feat(diagnostics): expose opt-in handler failure messages - #59

Merged
jmgilman merged 1 commit into
masterfrom
feat/agent-error
Sep 11, 2026
Merged

feat(diagnostics): expose opt-in handler failure messages#59
jmgilman merged 1 commit into
masterfrom
feat/agent-error

Conversation

@jmgilman

Copy link
Copy Markdown
Contributor

Summary

Closes #58.

  • Add codemode.AgentError for handler-authored, explicitly agent-facing failures. Find wrapped instances with errors.As; never disclose surrounding errors.
  • Sanitize only Message: replace non-printable runes with spaces, repair invalid UTF-8, and truncate on a rune boundary to 256 bytes including ....
  • Carry approved detail over the existing parent-owned native_abort frame. Preserve the terminal abort protocol and prevent child-origin capability-failure detail.
  • Preserve coarse root Error() and errors.Is behavior; format capability failed: <detail> in MCP.
  • Document the API, sanitization, and host responsibility not to disclose secrets.

Verification

  • Ran a standalone MCP client/server smoke program through a real re-executed worker: direct and wrapped AgentError, ordinary handler failure, and oversized control-filled message. Removed the smoke program afterward.
  • Added MCP acceptance coverage for Unicode boundaries, invalid UTF-8, empty/typed-nil errors, and ordinary/panic/policy/conversion nondisclosure. The existing Echo model-derived diagnostics through the coarse error taxonomy #24 MCP nondisclosure test is unchanged.
  • Verified native abort detail reaches Starlark's evaluator error text and does not authorize a child terminal capability-failure frame.
  • Repository validation uses mise exec -- moon run root:check --summary minimal (format, lint, build, MCP smoke, race suite, docs build).

@jmgilman
jmgilman merged commit 4b498a2 into master Sep 11, 2026
7 checks passed
@jmgilman
jmgilman deleted the feat/agent-error branch September 11, 2026 17:26
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.

Let handlers opt in to an agent-visible failure message

1 participant