fix(ask): arm the wizard_ask timeout per question, not per request - #1368
Conversation
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
Rebase the timeout fix onto the current main branch while preserving the TUI layer move.
5a9041e to
0138950
Compare
|
The branch is up to date with 🦉 via talyn.dev |
johncwaters
left a comment
There was a problem hiding this comment.
Note
Automated review. Not written by a human.
| private _resolveManualAuthCode: ((code: string) => void) | null = null; | ||
|
|
||
| /** Resolves the in-flight wizard_ask request. */ | ||
| private _noteAskProgress: (() => void) | null = null; |
There was a problem hiding this comment.
Note
Automated review. Not written by a human.
Nit: the doc comment "Resolves the in-flight wizard_ask request." now sits above _noteAskProgress instead of _resolvePendingQuestion. Move the new field above that comment or give it its own one-line comment.
Problem
The seeded data-source step is the one part of a run that stops to collect live credentials, and the connection forms behind it are long: a database source asks for most of host, port, database, user, password, schema and TLS/tunnel settings, and
wizard_askcarries up to twelve questions in one call for exactly that reason.The ask overlay walks those questions one at a time and resolves the request once, at the end of the walk. The ask bridge, meanwhile, documents a per-question timeout but armed a single timer when the request opened and raced it against the whole request. So a one-line question and a nine-field connection form got the same allowance, and when it expired on a user who was still working through the form:
Telemetry for this flow shows the losses concentrated on exactly the long forms: prompts carrying six or more questions are answered far less often than one-question prompts, and they account for a disproportionate share of timed-out asks, while short prompts are answered readily. Nothing in the data distinguishes a user who walked away from one who was cut off mid-form, because nothing recorded how far they got.
Why: a user who already agreed to connect a source, and is part-way through typing its credentials, should not lose the whole source to a clock that was never meant to measure the form.
Changes
createWizardAskBridgenow hands the host anonAnswercallback alongside the question's abort signal and re-arms its timer each time it fires. A request nobody touches still expires after the same wait, so single-question prompts — the large majority — behave exactly as before.WizardAskScreencallsstore.noteAskProgress()as it advances to the next question;WizardStore.requestQuestiontakes the callback and drops it when the request settles.AgentInteraction.askandWizardUI.requestQuestioncarry it through; hosts that answer in one shot can ignore it.wizard_ask cancelledcarriesquestions_answered. A count, never a value, so a request nobody touched is distinguishable from one abandoned part-filled — which is what makes this change measurable.Test plan
vitest run— 3437 tests pass across 204 files.tsc --noEmit,eslintandprettier --checkclean on the touched files.Created with PostHog Desktop
🤖 Generated with Claude Code