Skip to content

v0.12.0: continue session subcommand#33

Merged
askalf merged 2 commits into
masterfrom
feat/v0.12.0-continue-session
May 18, 2026
Merged

v0.12.0: continue session subcommand#33
askalf merged 2 commits into
masterfrom
feat/v0.12.0-continue-session

Conversation

@askalf
Copy link
Copy Markdown
Owner

@askalf askalf commented May 18, 2026

Summary

Adds deepdive continue <id> [<refined-question>] — a new subcommand that runs the full agent loop (plan + search + fetch + synthesize) seeded with a saved session's sources. Unlike resume (which just re-synthesizes against the saved corpus — cheap, no fetches), continue lets the planner expand the corpus with a tighter question while keeping the parent's sources in the pool.

  • AgentConfig.preKept?: SourceWithContent[] — saved sources are placed in the kept-sources pool after include[] (so local files still take precedence) and before search. Their URLs are added to seenUrls so the fetch loop won't re-fetch what the parent already paid for. Ids are reassigned sequentially so the synth packet stays well-formed.
  • SessionRecord.parentId?: string — backlink to the parent session. Additive: pre-v0.12.0 records load with parentId === undefined. Written only when set so the on-disk shape is preserved for runs that don't use continue.
  • src/cli.tscontinue joins SUBCOMMAND_VERBS. main()'s research path factored into a shared runResearch({question, parsed, config, preKept?, parentId?}) helper used by both the default invocation and the new continueCommand. persistSession threads parentId. USAGE text expanded.

Why a minor bump

New CLI subcommand (continue), new library surface (preKept? on AgentConfig, parentId? on SessionRecord), new on-disk session-record field. Purely additive — resume, show, and the default research path are byte-identical to v0.11.0 for runs that don't use continue.

Test plan

  • npm run typecheck clean
  • npm test — 423/423 green (417 prior + 6 new)
  • parentId round-trips through save/load
  • Pre-v0.12.0 records load with parentId === undefined
  • preKept seeds appear alongside fresh-fetched sources with reassigned sequential ids
  • preKept URLs dedupe against fresh search results — saved URLs never re-fetched
  • continue <id> and continue <id> <refined-question> both parse correctly
  • Manual smoke against dario after merge: run + continue with refined question, verify new session has parentId set

Adds `deepdive continue <id> [<refined-question>]` — runs a full agent
loop (plan + search + fetch) seeded with a saved session's sources.
Unlike `resume` (cheap re-synth, no fetches), `continue` lets the
planner expand the corpus with a tighter question. URLs from the parent
session are deduped against fresh search results so paid-for fetches
aren't repeated.

- AgentConfig.preKept?: SourceWithContent[] — seeds the kept-sources
  pool after include[] (so local files still take precedence) and
  before search. URLs added to seenUrls so the fetch loop skips them.
  Reassigns sequential ids so the synth packet stays well-formed.

- SessionRecord.parentId?: string — backlink to the parent session.
  Additive: pre-v0.12.0 records load with parentId === undefined.
  Written only when set so the on-disk shape is preserved for runs
  that don't use continue.

- src/cli.ts: continue joins SUBCOMMAND_VERBS. main()'s research path
  factored into a shared runResearch() helper used by both the default
  invocation and the new continueCommand. persistSession threads
  parentId. USAGE text expanded.

+6 tests across sessions / agent-loop / parse-args. 423/423 green.
@askalf askalf enabled auto-merge (squash) May 18, 2026 14:34
Comment thread test/agent-loop.test.mjs Fixed
…ositive

js/incomplete-url-substring-sanitization fired on tracker.fetched.includes("https://ex.com/saved") — the rule is about URL parsing, but here we're matching a literal string in an in-memory test tracker array. The deepEqual on the very next line already proves both that the saved URL was skipped AND that the new URL was the only fetch, so the includes call was redundant in any case.
@askalf askalf merged commit 826356c into master May 18, 2026
5 checks passed
@askalf askalf deleted the feat/v0.12.0-continue-session branch May 18, 2026 14:51
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.

2 participants