Repository navigation
fix: ask resume-session a question about the saved conversation - #86
Merged
Merged
Conversation
"Continue from the last conversation." left Droid nothing to do after a one-line earlier turn, so it often searched past sessions and then asked the user what to do next. The example sets no askUserHandler, so the SDK cancelled the question and the turn ended as interrupted. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
factory-droid
Bot
requested review from
factory-davidgu and
varin-nair-factory
November 27, 2026 07:13
factory-davidgu
approved these changes
Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What:
examples/node/resume-session.tsnow asks the resumed session "In one sentence, what did I ask you to do earlier in this conversation?" instead of "Continue from the last conversation." A comment explains why. The harness checks are unchanged.Why:
resume-sessionfailed the scheduled Examples run on Nov 13, 16 and 17, and needed a retry on Nov 27 (macOS). Each failure ends withTurn ended: interrupted.Root cause: The saved session's only earlier turn is "reply Metadata OK", so "continue" leaves Droid nothing to do. Droid often searches past sessions and the project, then calls
AskUserto ask what to do next.resumeSession()is called without anaskUserHandler, so the SDK cancels the question, which ends the turn as interrupted. I checked the transcripts of 11 failing local runs, and all 11 ended in a cancelledAskUser.The new prompt has a definite answer in the resumed conversation, so Droid answers directly. The answer also shows that the saved context carried over ("You asked me to reply with "Metadata OK" and nothing else.").
This is separate from #85, which fixes the same kind of interruption in the spec-mode examples. Neither PR depends on the other.
Validation
npm test(14/14),npm run typecheck,npm run lint,npm run format:check,npm run check:docs: all pass.node scripts/run-examples.mjs --only resume-session --runs 16 --retries 0, droid 1.21.1, Linux:main)workflow_dispatch(runs=2,retries=0, droid 1.21.1): https://github.com/Factory-AI/droid-sdk-typescript/actions/runs/45956290786.resume-sessionpassed 2/2 on ubuntu/Node 20, ubuntu/Node 22.23.5 and macOS/Node 22.23.5. The run's only failure isenter-spec-modeon ubuntu/Node 22.23.5, which fix: give the spec-mode examples a realistic task #85 fixes. This branch is based onmainwithout fix: give the spec-mode examples a realistic task #85.No new unit test:
npm testmakes no model calls. The live harness with--retries 0is the check that fails without this change (5/16 above).