fix(mothership): say why a workflow copilot chat cannot read other chats

Merged
WA
6d ago
+12-3

Summary

  • history search --chats from a workflow's copilot chat is refused by design (other chats are read back from home chats only), but the refusal said Chat not found about the caller's own, existing chat
  • The agent read that as a transient lookup failure and retried the identical command, up to three times in one chat
  • The refusal is now forbidden with the reason: "Reading other chats is available in home chats, not in a workflow's copilot chat", matching the neighboring "requires an agent chat" refusal. No concealment is lost: it is the caller's own chat, refused after authorization
  • What is listed, and for whom, is unchanged; the worker already surfaces Sim's refusal text and status for any non-OK answer

Type of Change

  • Bug fix

Testing

  • lib/mothership/chat/application/read-recall-chats.test.ts: the workflow-chat case now asserts the forbidden code and reason; 13/13 pass, and it fails against the previous not_found
  • bun run lint, check:api-validation:strict, check:comment-hygiene, check:test-patterns, check:utils, check:source-conventions
  • Type-check, full check:audits and the test suites run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)