Skip to content

feat(api): flag re-executed investigation lanes; correct the TTFT comment - #639

Merged
JeremyFunk merged 1 commit into
mainfrom
feat/investigation-lane-rerun-visibility
Aug 27, 2026
Merged

feat(api): flag re-executed investigation lanes; correct the TTFT comment#639
JeremyFunk merged 1 commit into
mainfrom
feat/investigation-lane-rerun-visibility

Conversation

@JeremyFunk

@JeremyFunk JeremyFunk commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

What

Investigating a TTFT/idle anomaly on an incident-investigation session surfaced two things worth landing:

1. Re-executed hypothesis lanes are now stamped maple.hypothesis.rerun.
A lane step whose result is lost to a retry boundary is re-run by the workflow engine on its own schedule — observed in production as a 4m23s silent hole followed by two lanes re-running with identical hypothesis ids, every span Ok, no failure recorded anywhere. The step now reads the lane row before claiming it (status past queued means a prior execution already ran) and passes rerun through to the lane agent, which stamps it on the investigation.hypothesis root span. Session views can then label the second wave as a re-run instead of anonymous idle-then-new-work.

Costs one SELECT per lane per attempt.

2. The annotateModelCallTiming comment claimed first-byte semantics TTFT never had.
The openai-chat protocol emits no step-start (only open-responses does), and role-only chunks, keep-alive comments and hidden reasoning produce no LLMEvents — so gen_ai.response.time_to_first_chunk measures to the first token-bearing frame. On reasoning models that includes the whole silent reasoning phase, which is why tool-call-only steps show TTFT near the span's full duration. The behavior is intended (first token to arrive client-side); the comment now says what is actually measured.

Verification

  • New test re-runs each hypothesis-* step callback (modeling the engine re-execution) and asserts the second execution sees rerun: true while the first sees false.
  • InvestigationFanoutWorkflow.run.test.ts: 16/16 pass.
  • turbo typecheck --filter=@maple/api: clean.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…ment

A lane step whose result is lost to a retry boundary is re-run by the
workflow engine on its own schedule - minutes later, with no failure
recorded anywhere. The re-execution's spans were indistinguishable from
new work, so a session view showed a silent multi-minute hole followed
by what looked like fresh lanes. The step now reads the lane row before
claiming it (past "queued" means a prior execution ran) and stamps
maple.hypothesis.rerun on the lane's root span.

Also corrects the annotateModelCallTiming comment: the openai-chat
protocol emits no step-start, and role-only chunks, keep-alives and
hidden reasoning produce no events, so TTFT is measured to the first
token-bearing frame - which on reasoning models spans the silent
reasoning phase. The behavior is intended; the comment claimed
first-byte semantics it never had.
@JeremyFunk
JeremyFunk force-pushed the feat/investigation-lane-rerun-visibility branch from 9787d41 to 6f1d67d Compare August 27, 2026 06:53
@JeremyFunk
JeremyFunk merged commit 04c8b9c into main Aug 27, 2026
27 checks passed
@JeremyFunk
JeremyFunk deleted the feat/investigation-lane-rerun-visibility branch August 27, 2026 11:58
@github-actions

Copy link
Copy Markdown

🍁 Maple PR preview

Warning

Preview cleanup could not be confirmed. The Alchemy teardown outcome was skipped.

Final commit 6f1d67d · View workflow run

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