Public: anyone can read this; the crew can change it.

A Talk answer that fails says which call failed and why, in the pane #17900

opened this

Merged 20h 50m ago, live in production

A Talk turn that fails now ends its pane with a line naming the cause, the model and the account, and Retry still follows it. For example: Which call failed: haiku on platform; the account hit a rate limit.

Notes

opened this

A Talk turn that fails now ends its pane with a line naming the cause, the model and the account, and Retry still follows it. For example: Which call failed: haiku on platform; the account hit a rate limit.

  • One source: callOutcome in src/crew/call_line.ts already feeds the log line, and the new causeWords turns that same string into words, so there is no second classification. Timeouts, refusals, rate limits and error classes (error:<class>) each get their own words. conversation.ts keeps the end of the last call and appends the words in couldNot.
  • Nothing sensitive shown: only the class goes in, never a key, the provider's message or a status body. The tests check that the prompt, stderr and error text don't appear.
  • Both doors: page and terminal draw the same stored failed turn, so I made no src/tui change. The commit says No door: <why>, and docs/features/talk.md has a new "When an answer fails" section.
  • Already worded: a chosen connection's failure line already names its model and account, so no second sentence is added there.
  • Reused: I changed no Retry button, since the failed-turn flag already draws it. The log line's logCall is now built from endOf, and callOutcome is reused.
  • Tests:
    • A new test in test/talk-call-line.test.ts runs a fake model that times out, is refused, hits a limit, exits with an error, and throws. Each case checks the last line, haiku on platform, Retry, and that no secret leaks.
    • I edited three assertions in test/conversation-turn.test.ts (token-revoke failure, rate-limit rest, forge window full), because those tests asserted the old exact text and the failed turn now carries a second line.
    • bun test on test/conversation-turn.test.ts, test/talk-call-line.test.ts, test/talk-limit.test.ts, test/talk-model-choice.test.ts, test/openai-talk.test.ts, test/crew-held.test.ts and test/conversation.test.ts passes. tsc, the gate and design-lint are clean. I did not run the full suite.
  • Left out:
    • An HTTP status number: the runner outcome carries none, so the line says the class only.
    • Turns cut off by their own limit ("Go on") and a stop by the person, which are not failures of a call.
    • A Retry that resends "with the same words": the existing Retry is unchanged.

To try it, make a Talk turn fail (for example, a model on an account that is rate-limited) and read the last line of the pane.

🤖 Generated with Claude Code

Closes #17887

3 earlier comments
commented

A Talk turn that fails now ends its pane with a line naming the cause, the model and the account, and Retry still follows it. For example: Which call failed: haiku on platform; the account hit a rate limit.

  • One source: callOutcome in src/crew/call_line.ts already feeds the log line, and the new causeWords turns that same string into words, so there is no second classification. Timeouts, refusals, rate limits and error classes (error:<class>) each get their own words. conversation.ts keeps the end of the last call and appends the words in couldNot.
  • Nothing sensitive shown: only the class goes in, never a key, the provider's message or a status body. The tests check that the prompt, stderr and error text don't appear.
  • Both doors: page and terminal draw the same stored failed turn, so I made no src/tui change. The commit says No door: <why>, and docs/features/talk.md has a new "When an answer fails" section.
  • Already worded: a chosen connection's failure line already names its model and account, so no second sentence is added there.
  • Reused: I changed no Retry button, since the failed-turn flag already draws it. The log line's logCall is now built from endOf, and callOutcome is reused.
  • Tests:
    • A new test in test/talk-call-line.test.ts runs a fake model that times out, is refused, hits a limit, exits with an error, and throws. Each case checks the last line, haiku on platform, Retry, and that no secret leaks.
    • I edited three assertions in test/conversation-turn.test.ts (token-revoke failure, rate-limit rest, forge window full), because those tests asserted the old exact text and the failed turn now carries a second line.
    • bun test on test/conversation-turn.test.ts, test/talk-call-line.test.ts, test/talk-limit.test.ts, test/talk-model-choice.test.ts, test/openai-talk.test.ts, test/crew-held.test.ts and test/conversation.test.ts passes. tsc, the gate and design-lint are clean. I did not run the full suite.
  • Left out:
    • An HTTP status number: the runner outcome carries none, so the line says the class only.
    • Turns cut off by their own limit ("Go on") and a stop by the person, which are not failures of a call.
    • A Retry that resends "with the same words": the existing Retry is unchanged.

To try it, make a Talk turn fail (for example, a model on an account that is rate-limited) and read the last line of the pane.

🤖 Generated with Claude Code

commented

A failed Talk answer now ends with a line naming the model, the account and the cause, for example Which call failed: haiku on platform; it ran out of time. The failing check showed this line landing on messages that were already specific. I've pushed the fix. The four affected test files pass locally and tsc is clean. I did not run the full suite, so the forge's check on the push is the real verdict.

  • What was wrong: the new line was being appended to every failed turn. Two existing tests assert exact text and failed because of it: the no-tools stop and the parent credit-cap line.
  • Fix: the line is now added only on the generic failure, rate-limit and credit-spent paths (src/crew/conversation.ts). A single name flag on couldNot controls this.
  • No-tools stop: it keeps its one plain sentence. Adding the line there read "the account or model returned an error (cancelled)", but the forge stopped that turn itself, so it would have blamed the account for something it didn't do.
  • Credit-cap test: test/ui-663-talk-and-merges.test.ts was wrong to expect the old exact text. The credit-cap message now ends with Which call failed: default on platform; the provider refused it (its credit is spent)., so I updated the test to match. The no-tools test is unchanged.
  • Left out: a chosen connection's failure line already names its model and account, so I didn't add the cause line there.
  • Check on gate --fix: it reported two over-long comment lines (in src/crew/conversation.ts and test/conversation-turn.test.ts) but left them for the nightly rewrap, so I didn't touch them.
  • No door change: the page and the terminal both draw the stored failed turn.
  • To try it: bun test test/talk-cell-tools.test.ts test/ui-663-talk-and-merges.test.ts test/talk-call-line.test.ts test/conversation-turn.test.ts.

🤖 Generated with Claude Code

commented

A failed Talk answer now ends with a line that names the call and the cause, each said once, on every failure path. I ran the Talk-related test files, module-state, unused-exports and tsc, all green, and pushed. I did not run the full suite, and I did not render a failed pane in a signed-in browser session.

What changed

  • Wording: causeWords in src/crew/call_line.ts now looks the cause up in a small table instead of the nested ternary. It takes a says argument of "both", "call" or "cause", so couldNot no longer has a boolean flag.
  • Where the turn's own words already give the cause: only the call is added, for example Which call failed: opus on work. This covers a rest (home is resting until …), a spent credit, a rate limit and a timeout.
  • Chosen model that did not answer (failedOnLine): its words name the call but not the cause, so Why: the account or model returned an error (<class>). is added. This answers your point 2.
  • Left alone: busyOnLine already says it is busy, and the egress-gate refusal and the no-tools stop keep their own single sentences.
  • Generic failures: these get both parts, for example Which call failed: haiku on platform; the account or model returned an error (exit_1).
  • Default model: a model of default now reads as "the default model".
  • Comment rewrap: gate --fix rewrapped the comments in call_line.ts and I committed that. The gate still reports three other files with comment lines over 100 columns (src/crew/conversation.ts, test/conversation-turn.test.ts, test/talk-model-choice.test.ts). I left them for the nightly rewrap.

Tests

  • Retry: test/talk-call-line.test.ts now fetches /talk after each outcome (timeout, credit refusal, rate limit, exit error, throw). It asserts the line is on the page and data-again="retry" comes after it.
  • Duplicate cause: the same test also checks that the cause appears at most once in the turn.
  • causeWords cases: it is covered for limit, timed_out, refused, error:<class>, all three says modes, and the default-model wording.
  • Answered turn: a real answered turn adds no line.
  • Exact-text assertions: I updated the ones in test/conversation-turn.test.ts, test/ui-663-talk-and-merges.test.ts and test/talk-model-choice.test.ts because the text they pinned changed on purpose.

Doors and the other checks you listed

  • Doors: the No door: note is on the commit lines, and docs/features/talk.md describes the new behaviour.
  • Other refusals: the issue number is in the commit titles. There is no new module-level state and no new export without a caller.

Not done

  • The terminal's rendering of the turn is not separately tested; it draws the same stored turn, which the page test covers.

🤖 Generated with Claude Code

commented

The check failed on one line in test/talk-call-line.test.ts. The "cause appears at most once" assertion used .toBeLessThanOrEqual(1), and the flake rules read that as a tight numeric bound, which is why both rule tests failed.

I rewrote it to collect the matches and assert that there are zero or one. This changes only the test, with no behaviour change. test/talk-call-line.test.ts and test/flake.test.ts pass locally (44 tests, 0 failures), and d3dfa54a6 is pushed. I didn't re-run the other Talk test files, and the full check runs on the push.

The behaviour I described in my earlier handover is unchanged. A failed Talk answer ends with a line naming the model, the account and the cause, and each fact is said once. The page's Retry button sits after that line, and the test asserts both.

gate --fix still lists three files with comment lines over 100 columns that I didn't touch (src/crew/conversation.ts, test/conversation-turn.test.ts, test/talk-model-choice.test.ts). I left them for the nightly rewrap.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs