Skip to content

fix(runtime-host): log why a transcript page read failed - #5573

Open
MoonOld wants to merge 1 commit into
apache:mainfrom
MoonOld:fix/runtime-host-transcript-page-diagnostic
Open

MoonOld wants to merge 1 commit into
apache:mainfrom
MoonOld:fix/runtime-host-transcript-page-diagnostic

Conversation

@MoonOld

@MoonOld MoonOld commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

SessionContinuityCoordinator#readTranscriptPage collapses every error that is not a TranscriptPageRequestError into persistence_failed / "Session transcript is unavailable", and returns it as an operation outcome. Because the handler returns instead of throwing, the [runtime-host] unexpected <operation> failure log in operation-dispatcher.ts — the only caller of boundedFailureDiagnostic — never runs for this operation. The cause therefore reaches neither the Runtime Host log, the desktop diagnostic report, nor the Renderer, which falls back to generic copy ("任务内容暂时无法刷新,请稍后重试。").

This records the cause with boundedFailureDiagnostic before the generic outcome is returned. The outcome the caller receives is unchanged; the only new output is one [runtime-host] log line.

Refs #5572

Verification

  • npm --workspace @maka/runtime-host run typecheck — clean
  • npx biome check on both touched files — clean
  • node --test packages/runtime-host/dist/__tests__/session-continuity-coordinator.test.js — 47/47 pass
  • Fails without the change: with the source hunk reverted and the test kept, the new case fails with AssertionError (0 pass / 1 fail)

The new test injects a reader that fails only on the page path — bootstrap requests carry no position, page requests always do — then asserts the generic outcome is still returned and that console.error was called exactly once with the injected cause:

✔ a failed transcript page records the underlying cause before the generic outcome
ℹ tests 47 / pass 47 / fail 0

Not run: the full workspace test suite.

Review focus

Whether logging directly here is right, versus routing it through onPublicationFailure. The sibling bootstrap path (session-continuity-coordinator.ts:966) calls onPublicationFailure under a comment saying the failure "has to leave a trace here", but that hook is wired to context.requestDrain (execution-composition.ts:925), not a logger — so no trace is emitted there either. That path is deliberately untouched here; it is context for #5572, not part of this change.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka (a DeepSeek-backed agent running in Maka Desktop) drafted the log line and the regression test, and ran the verification commands above. The root-cause analysis that motivated the change was reviewed and corrected before this PR by the author.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

SessionContinuityCoordinator#readTranscriptPage collapses every error that
is not a TranscriptPageRequestError into persistence_failed with "Session
transcript is unavailable", and returns it as an operation outcome. Because
the handler returns instead of throwing, the "[runtime-host] unexpected
<operation> failure" log in operation-dispatcher.ts - the only caller of
boundedFailureDiagnostic - never runs for this operation. The cause then
reaches neither the Runtime Host log, the desktop diagnostic report, nor
the Renderer, which falls back to generic copy.

Record the cause with boundedFailureDiagnostic before returning the
generic outcome. The outcome the caller receives is unchanged.

Refs apache#5572

Generated-by: Maka

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant