You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consolidate repeated session.action.abort diagnostic emission into a small shared helper without changing abort behavior or losing caller-specific session ID semantics.
When this is done, abort diagnostics should still record the same payload shape (source, mode, result, plus route / visible / timeline session IDs), but the shared construction / emission code should live in one place so future diagnostic field changes do not need to be repeated across multiple callers.
Scope
In scope:
Add a shared helper for session.action.abort diagnostic payload construction / emission.
Update the existing abort diagnostic call sites to use the helper:
Preserve each caller's existing session ID semantics. The helper should accept explicit route / visible / timeline IDs; it should not guess or fall back silently.
Preserve the existing diagnostic data fields: source, mode, and result.
submit.ts emits for the active visible session used by prompt submission / stop actions.
session.tsx can distinguish route session from timeline session for revert and auto-heal paths.
use-session-commands.tsx undo currently operates on params.id; if this behavior is changed, it should be justified separately rather than hidden inside the helper extraction.
Gemini's point is valid tech debt: the diagnostic emission shape is duplicated, and a helper would reduce drift risk. It was deferred from #556 because #556 was a user-facing abort semantics fix, while this is observability cleanup.
Verification
Run bun --cwd packages/app typecheck.
Run targeted app tests that cover prompt submit / abort behavior, at minimum:
bun --cwd packages/app test src/components/prompt-input/submit.test.ts --preload ./happydom.ts
Run or update any targeted tests for the extracted helper if it is placed behind a testable utility boundary.
Run git diff --check.
Confirm diagnostics still emit session.action.abort with source, mode, and result from all migrated call sites.
Goal
Consolidate repeated
session.action.abortdiagnostic emission into a small shared helper without changing abort behavior or losing caller-specific session ID semantics.When this is done, abort diagnostics should still record the same payload shape (
source,mode,result, plus route / visible / timeline session IDs), but the shared construction / emission code should live in one place so future diagnostic field changes do not need to be repeated across multiple callers.Scope
In scope:
session.action.abortdiagnostic payload construction / emission.packages/app/src/components/prompt-input/submit.tspackages/app/src/pages/session.tsxpackages/app/src/pages/session/use-session-commands.tsxsource,mode, andresult.Out of scope:
softorhardaborts.Relevant files or context
Follow-up from PR #556 Gemini review thread:
Current caller-specific ID semantics to preserve:
submit.tsemits for the active visible session used by prompt submission / stop actions.session.tsxcan distinguish route session from timeline session for revert and auto-heal paths.use-session-commands.tsxundo currently operates onparams.id; if this behavior is changed, it should be justified separately rather than hidden inside the helper extraction.Gemini's point is valid tech debt: the diagnostic emission shape is duplicated, and a helper would reduce drift risk. It was deferred from #556 because #556 was a user-facing abort semantics fix, while this is observability cleanup.
Verification
bun --cwd packages/app typecheck.bun --cwd packages/app test src/components/prompt-input/submit.test.ts --preload ./happydom.tsgit diff --check.session.action.abortwithsource,mode, andresultfrom all migrated call sites.Execution mode
Agent can implement directly