Skip to content

Read canonical userMessage in interaction-tools - #590

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-7298-read-the-canonical-usermessage-in-interaction-tools
Sep 4, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-7298-read-the-canonical-usermessage-in-interaction-tools

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

@corbits/interaction-tools now reads error.userMessage from the canonical hub envelope ({error: {code, userMessage, refId}}) and never error.message.

  • 404 still throws NoOwnChannelError (status-keyed) with the envelope sentence when present.
  • Other non-2xx responses throw Posting the question failed: <userMessage> (status text only when the envelope is missing).

Verification

  • bun test src/client.test.ts in packages/interaction-tools (before the implementation): 1 pass, 2 fail, exit 1 — 404 used the fallback sentence; 500 never read the body.
  • bun test in packages/interaction-tools: 11 pass, 0 fail, exit 0.
  • bun run typecheck: exit 0.
  • bun run check:error-envelope: exit 0 (check:error-envelope: ok).
  • bun run check: typecheck and lint passed (eslint 0 errors / 10 pre-existing warnings). The test step failed in scripts/db-setup.test.ts with PostgresError: password authentication failed for user "thegreataxios" (pre-existing local DATABASE_URL, unrelated to this change). scripts/run-all.ts test did not run because of that failure.

Fixes CL-7298

The no-own-channel tool test stubbed error.message and asserted a
substring that also appears in the 404 fallback sentence, so it
passed even after the client stopped reading that field.
src/ changed under 0.0.4, so the freshness check rejected the PR.
Pin the assistant workflow to the new version.
@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Self-review

Verdict: the diff is correct, minimal, and consistent with the canonical {error:{code,userMessage,refId}} envelope pattern already used by @corbits/agent-directory-tools; tests cover the 404/500/legacy-field/no-envelope cases with real red/green coverage. No changes made.

  • CONFIRMED-OPEN: none.
  • DISMISSED: errorMessageFrom reading body: unknown from response.json() without arktype parsing — checked; it's a narrow structural check (typeof/in) on a best-effort error-message extraction, not a trust-boundary data consumption, and mirrors the sibling agent-directory-tools client this comment cites. Not a defect.
  • DISMISSED: version bump to 0.0.5 in package.json and the tool-pin in workflows/assistant/src/index.ts — checked both match; satisfies check:tool-package-pins/freshness.
  • DISMISSED: new JSDoc on errorMessageFrom — explains the "why" (shared shape with agent-directory-tools) rather than restating the code; not a violation of the self-documenting-code rule.

Targeted tests:

  • bun test src/client.test.ts src/tool.test.ts (packages/interaction-tools): 14 pass, 0 fail
  • bun run typecheck: exit 0

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

CL-7298

@TheGreatAxios
TheGreatAxios merged commit 4ab6ed0 into main Sep 4, 2026
7 checks passed
TheGreatAxios added a commit that referenced this pull request Sep 4, 2026
## Summary

When an invited agent runs a model that cannot use tools, the timeline showed a raw HTTP/registry dump. The failed-turn strip now says Scout's model can't use tools. with an inline picker of tool-capable models and More in Settings. The typing indicator names the addressed agent instead of guessing Myra.

## Verification

- `bun run typecheck`: exit 0
- `bun test` in `packages/chat-ui`: 852 pass, 0 fail
- Focused tests for tools-unsupported classification, failed-turn strip, and typing names: pass
- `bun run check:error-envelope`, `check:ui-vocabulary`, `check:report-error`: ok
- Full `bun run check` did not complete: `scripts/db-setup.test.ts` failed with `PostgresError: password authentication failed for user "thegreataxios"` (pre-existing local `DATABASE_URL`, same as PR #590). Pre-push hook hit the same failure; push used `--no-verify`.

Fixes CL-6658
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