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

Every model call in Talk writes one log line: account, model, seconds, how it ended #17838

opened this

Merged 4h 40m ago, live in production

Every Talk model call now writes one log line with the account, model, seconds and how it ended. For example: talk model call account=platform model=haiku seconds=3.2 outcome=timedout. What changed New src/crew/callline.ts.

Notes

opened this

Every Talk model call now writes one log line with the account, model, seconds and how it ended. For example: talk model call account=platform model=haiku seconds=3.2 outcome=timed_out.

What changed

  • New src/crew/call_line.ts. callOutcome and callFields turn a runner's outcome into the line's fields.
  • src/crew/conversation.ts times the runner call and logs the line right after it ends, whether it returned or threw.
  • account is the subscription's name, the connection's name, or platform. model is the chosen model or the forge's default.
  • outcome is one of answered, timed_out, refused, limit, stopped, or error:<class>.
    • refused covers a 402 (credit spent) and a key the provider refused.
    • limit covers a rate limit.
    • stopped is a person stopping the turn or a restart cutting it. I added it because it isn't an error.
    • The error class is the runner's reason code, cut to [a-z0-9_] (exit 1 becomes error:exit_1, a thrown error is error:threw). Runner messages are never logged.
  • The line carries no prompt, answer, tokens or keys. Nothing else in the turn's flow changed, so the strip of numbered versions is untouched.

Test test/talk-call-line.test.ts drives real say() turns through a fake runner that ends seven ways. It checks the one line each time and that the prompt, answer, stderr and error text don't appear in it. A second test covers how the error class is cleaned up.

I ran that file and test/talk-model-choice.test.ts (18 pass), tsc --noEmit and the gate. bun scripts/fast.ts named 261 files, about 15 minutes of tests, over its 5-minute budget, so I ran only those two files. The forge runs the full check on the push.

Left out

  • No web page, API or MCP change, so there's no terminal or docs/features counterpart.
  • No sampling or rotation. It's one info line per turn, which I judged low volume.
  • The log doesn't say which retry or resume attempt a line came from.
  • The gate noted one comment over 100 columns in src/crew/conversation.ts, and I left it for the nightly rewrap.

Try it Send any Talk message and look for talk model call in the forge's log. Or run bun test test/talk-call-line.test.ts.

Closes #17825

commented

Every Talk model call now writes one log line with the account, model, seconds and how it ended. For example: talk model call account=platform model=haiku seconds=3.2 outcome=timed_out.

What changed

  • New src/crew/call_line.ts. callOutcome and callFields turn a runner's outcome into the line's fields.
  • src/crew/conversation.ts times the runner call and logs the line right after it ends, whether it returned or threw.
  • account is the subscription's name, the connection's name, or platform. model is the chosen model or the forge's default.
  • outcome is one of answered, timed_out, refused, limit, stopped, or error:<class>.
    • refused covers a 402 (credit spent) and a key the provider refused.
    • limit covers a rate limit.
    • stopped is a person stopping the turn or a restart cutting it. I added it because it isn't an error.
    • The error class is the runner's reason code, cut to [a-z0-9_] (exit 1 becomes error:exit_1, a thrown error is error:threw). Runner messages are never logged.
  • The line carries no prompt, answer, tokens or keys. Nothing else in the turn's flow changed, so the strip of numbered versions is untouched.

Test test/talk-call-line.test.ts drives real say() turns through a fake runner that ends seven ways. It checks the one line each time and that the prompt, answer, stderr and error text don't appear in it. A second test covers how the error class is cleaned up.

I ran that file and test/talk-model-choice.test.ts (18 pass), tsc --noEmit and the gate. bun scripts/fast.ts named 261 files, about 15 minutes of tests, over its 5-minute budget, so I ran only those two files. The forge runs the full check on the push.

Left out

  • No web page, API or MCP change, so there's no terminal or docs/features counterpart.
  • No sampling or rotation. It's one info line per turn, which I judged low volume.
  • The log doesn't say which retry or resume attempt a line came from.
  • The gate noted one comment over 100 columns in src/crew/conversation.ts, and I left it for the nightly rewrap.

Try it Send any Talk message and look for talk model call in the forge's log. Or run bun test test/talk-call-line.test.ts.

commented

Each runner call to the model now logs its own line as it ends or throws, with its own start time. I've pushed this to the same branch; bun test on the two Talk test files and tsc --noEmit pass.

What changed

  • One line per call. The log moved from after the loop into it, right after each run(...) resolves or throws. A lost session followed by a fresh start now writes two lines, each with its own seconds. A throw logs with the right seconds before it propagates.
  • No call, no line. A turn that skips the loop (a removed chosen connection, gone) writes nothing, so it no longer reports error:threw.
  • stopped only when true. callOutcome returns answered first and reads stopped only for a call that did not answer. An answer that landed just before a stop stays answered.

Tests in test/talk-call-line.test.ts

  • The lost-session case: the first call fails with "No conversation found", the second answers, and there are two lines.
  • The removed-connection case: no runner call, so zero lines.
  • A unit check that an answered call with a stop flag is still answered and a cancelled one is stopped.

Gate gate.ts flags call and sayIn in the test file as 0.59 similar. Both are small test helpers, and I left them as they are. It also still notes the over-100-column comment in src/crew/conversation.ts, which was already there, for the nightly rewrap.

I didn't run the full suite. The /llms.txt budget and dead-code checks are left to the forge's check. Neither this change nor the earlier version adds an export that lacks a caller, and nothing touches llms.txt.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs