Skip to content

chat: log the undelivered-turn cause and thread a reportError refId (CL-6644, part A) - #313

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-6644-wake
Aug 22, 2026
Merged

chat: log the undelivered-turn cause and thread a reportError refId (CL-6644, part A)#313
TheGreatAxios merged 2 commits into
mainfrom
cl-6644-wake

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

CL-6644 part A: diagnosability. A turn that fails end-to-end left zero log
trace — dispatchTurnBatch's catch logged through a bare getLogger call,
never through @corbits/error-sink's reportError, so an undelivered
notice never carried a refId a person could quote to support.

  • dispatchTurnBatch's catch now calls reportError (operation
    chat.dispatchTurn, tenant/room/agent context, the message ids) before
    logging and posting the notice, and threads the returned refId into
    postUndeliveredNotice.
  • The notice text now ends with (ref <refId>) — cheap enough to fold in
    now rather than waiting on CL-6641 item 3's own UI surface.
  • Added @corbits/error-sink as an explicit packages/chat dependency.

Part B (wake never completes) — not fixed here

I spent the session's timebox tracing the wake hop
(ensureAwake/wakeByAddress/wakeFoldedRun/deployAdoptedWorkflowFromSource)
and could not pin the stalling hop to a specific line with the confidence
this repo's "no guessing" bar requires, without a live repro run against
the shared stack (which I was told not to restart unless dead). The
strongest lead: c83f3821 ("Sidecar boot restore: skip parked
deployments...") justifies skipping a parked record's boot restore by
saying it "resumes correctly on the next message... the same wake path
that already handles a cold deployment" — but 0fd3fbc8 ("replace idle
park/wake with reap-and-relaunch teardown") had already deleted that
in-place wake-on-mail-route path days earlier. wakeByAddress
(packages/chat/src/platform-adapter.ts) still carries a CL-6267 comment
describing that same deleted mechanism ("the sidecar's own park
wake-handler owns respawning a parked-but-still-announced deployment").
This mismatch is worth a live-repro session to confirm or rule out before
touching sidecar code — filing as a Linear comment on CL-6644 rather than
guessing a fix blind.

Test plan

  • WORKBENCH_CHECK_SINCE=origin/main bun run typecheck — pass
  • WORKBENCH_CHECK_SINCE=origin/main bun run lint — pass
  • WORKBENCH_CHECK_SINCE=origin/main bun run test — pass, including a
    new red/green test asserting the notice carries (ref ...)
  • Live repro (send → typing → real Ollama reply) — not run; see Part B
    note above

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