feat: Deep Research agents, spend guard, citations (0.4.0) - #11
Merged
Conversation
Re-opens what #9 closed, with a corrected reading of why #9 failed. #9 was closed on the claim that 13.0.0-13.0.2 ship no prebuilt binaries. That was wrong: it was read off the GitHub *release* assets, which are empty for 13.x, not off the npm tarball, which is what npm actually installs. Registry metadata is unambiguous: 13.0.0 / 13.0.1 scripts.install = "node-gyp rebuild" gypfile = true 13.0.2 / 13.0.3 scripts.install = absent gypfile = false and the 13.0.2 and 13.0.3 tarballs both carry all 8 prebuilds, win32-x64 included. So 13.0.2 is already the fixed shape — the compile-from-source window was 13.0.0-13.0.1 only. What that does not yet explain is why #9's CI ran `node-gyp rebuild` for 13.0.2 and died on VS 2026 detection under node 22. I could not reproduce it: `npm ci` against #9's exact package.json + lockfile on Windows, node 22, under npm 10.9.3, 10.9.8 and 11 installs 44 packages in ~2s with no compile. Five clean attempts, no repro. This PR is the experiment that settles it — same bump, but with a lockfile regenerated by a real `npm install` rather than Dependabot's metadata-only rewrite, which is the one input I could not reproduce locally. If CI is green, that difference was the cause. Fallout of the move, all consistent with the install script being gone: allowScripts drops better-sqlite3 entirely, script-lens.json records zero packages with install-time behavior, and the lockfile loses 413 lines as the prebuild-install subtree goes with it. Offline tests pass. Cooldown: 13.0.3 clears the 72h window tomorrow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…3.5-flash-lite (0.4.0) - research/batch grow -a/--agent: interactions.create is sent `agent` INSTEAD of `model` (mutually exclusive; passing both is a clean error). Aliases resolve through one table (deep-research, deep-research-max -> the full preview ids); unknown ids pass through so future agents need no release. - Spend guard: agent submissions print the documented per-task band ($1-$3 / $3-$7, quoted with the docs own hedge), batch prints N x band, and require y/N confirmation -- --yes when stdin is not a TTY, --dry-run to preview. Declining or refusing writes zero rows. - Result extraction takes the final answer-bearing step (docs: steps[-1].content[0].text) with a collect-everything fallback; citations are persisted, printed as Sources:, and carried in --json. - Additive migration: agent + citations columns; pre-0.4.0 stores upgrade in place, agent NULL. list grows an AGENT column when relevant; stats tallies agent runs. - Default model: gemini-3.1-flash-lite -> gemini-3.5-flash-lite (GA 2026-07-21). - 15 new offline tests (agent shapes, guard paths, budget-pause incomplete, agent 404 retirement, v0.3.0 migration); all 49 pre-existing tests intact. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
better-sqlite3 13.x dropped its `install` script and ships N-API prebuilds in the tarball, so nothing in the tree needs building. Without --ignore-scripts npm sees its binding.gyp, falls back to `node-gyp rebuild`, and node 22 / windows-latest fails: the runner image now carries Visual Studio 18, which node-gyp 11.5.0 (bundled with Node 22) reports as an unknown version. Node 24 ships a newer node-gyp and passed, which is why only one matrix cell was red. Verified on Windows + Node 22 (the failing combination): npm ci --ignore-scripts leaves no build/Release, loads prebuilds/win32-x64.node, and the full suite passes. The package job still does a real, un-ignored global install from the packed tarball, so the user install path stays covered. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Ships gemcatch 0.4.0. Includes the better-sqlite3 13.x bump from #10 (this branch is stacked on it, so #10 closes as merged with this).
Added
-a, --agent <id>onresearchandbatch.interactions.createis sentagentinstead ofmodel(mutually exclusive; passing both is a clean error and writes nothing). Aliases resolve through ONE table:deep-research->deep-research-preview-04-2026,deep-research-max->deep-research-max-preview-04-2026; any other value passes through unchanged, so a future agent id needs no release. Agents mandatebackground=true, which gemcatch has always set, and the free tier drops interactions after 1 day -- which is exactly the race the daemon exists to win.batchprints N x band as a total; an interactive y/N is required,--yeswhen stdin is not a TTY, and--dry-runpreviews the full projected spend and submits nothing. Declining or refusing leaves the store untouched.Sources:, and carried in--json.steps[-1].content[0].text) with a collect-everything fallback -- one rule for agent and model runs, no string-matching on the agent id.agent+citations. A pre-0.4.0tasks.dbupgrades in place, keeps every row, reportsagentas NULL.Changed
gemini-3.1-flash-lite->gemini-3.5-flash-lite(GA 2026-07-21).Verification
npm test: 64 green -- all 49 pre-existing cases plus 15 new (agent response shapes, every spend-guard path,--model+--agentrejection, unknown-agent 4xx surfaced unretried,incompletebudget-pause retiring cleanly, agent 404-after-retention, v0.3.0 migration). No key, no network. Also driven end-to-end from a packed tarball installed into a clean directory against a standalone mock.Not verified: a live-API agent run, which costs $1-$3 per task.