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
{{ message }}
Repository navigation
Commit 3875d00
Browse filesBrowse the repository at this point in the historyBrowse files
fix(onboarding): repair regressions the first round of bot fixes introduced
The close-handler fix in `fe6ac08` inverted the metric it was meant to repair,
and two others had side effects. Found by `cubic` on the pushed head and by a
class-scoped `codex` sweep.
- `dialog-scan-gate.tsx` / `app.tsx`: `run()` calls `dialog.clear()` before
`props.onChoose(arg)`, and `dialog.clear()` invokes the close handler
synchronously — so the latched `dismissed` recorder consumed EVERY Yes/No and
the funnel reported a dismissal for every real choice. New `onOutcome` seam,
invoked before the clear on both the choice and dismiss paths; `onChoose` keeps
its position after the clear so the prompt-submit ordering is unchanged.
- `app.tsx`: dropped `markFirstRunActive()` from the pre-completed-setup branch.
Its only clear is `markSetupComplete()`, which has already run there, so the
flag latched true for the session and every later `/model` pick would have
emitted funnel events.
- `telemetry/index.ts`: publishing `initPromise = reinitPromise` made
`doShutdown()`'s reset guard miss, leaving `initDone` true while `enabled` was
already false — `track()` then silently DROPPED events in exactly the window
the reinit path exists to protect. Reset `initDone` when publishing.
- `telemetry/index.ts`: the shutdown budget was still not hard. One absolute
deadline now spans the drain and the final flush, and a drain that expires
aborts the in-flight request rather than letting the final flush chain behind
the very request it gave up on — which is what made the timeout buy nothing.
Retry write-back is suppressed during shutdown, since re-inserting into a
buffer about to be cleared only ships those events under the next launch id.
Tests. The existing scan-gate tests all passed against wiring that does not
exist: `mountGate()` renders the gate as a plain child of `DialogProvider`, while
production mounts it through `dialog.replace(fn, onClose)`. Added
`mountGateAsApp()`, which reproduces the real wiring, plus three tests over it
(scan, skip, escape). Added a shutdown-budget test with a hanging request. All
four new tests were mutation-checked: they fail with their fix reverted, and the
budget test hangs for the full 10s default without the abort.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018SLUQF3xgZHsGZHSjxe7vb
0 commit comments