Skip to content

docs: accuracy audit of README, guides, and examples (+2 SDK fixes)#66

Merged
varin-nair-factory merged 10 commits into
mainfrom
docs/accuracy-audit
Jun 16, 2026
Merged

docs: accuracy audit of README, guides, and examples (+2 SDK fixes)#66
varin-nair-factory merged 10 commits into
mainfrom
docs/accuracy-audit

Conversation

@varin-nair-factory

Copy link
Copy Markdown
Contributor

Summary

Full accuracy audit of all user-facing documentation ahead of the SDK's private preview. Every code example was extracted, imported from the built package, and run live against the droid CLI 0.146.0; inaccuracies were fixed and re-verified. The audit surfaced two genuine SDK bugs (the documented patterns were correct; the code was wrong), which are fixed here with regression tests.

SDK fixes

  • Permission handlers broke on MCP tools — the schema rejected newer CLI option values (e.g. proceed_always_tools). Schemas now accept unknown values forward-compatibly. (ccf25e1)
  • resumeSession(id) crashed with one argument and stripped an ambient FACTORY_API_KEY. Options are now optional and ambient env is preserved. (8140fa4)

Both include regression tests.

Documentation corrections (all examples re-verified live)

  • README: added required apiKey to every example with the stored-credentials nuance; fixed 7 dead AssistantTextDelta snippets (default stream needs includePartialMessages); fixed unknown structuredOutput access; permission example now sets autonomy so the handler actually fires; real CLI tool IDs; removed the false "allowlist" claim; updated examples list; removed rewind.
  • SDK guide: regrouped into navigable sections with a TOC; fixed MCP permission/server-management examples; real tool IDs; documented error-result states, permission default = Cancel, hooks-must-be-configured; removed rewind.
  • Daemon guide: removed the non-existent MachineType.Ephemeral; expanded the DaemonSession method list; prominent "apiKey strictly required, no fallback" note; added TOC; corrected an export claim and tool-id wording.
  • Examples: deleted test-rewind.ts and the duplicate droid-dev-structured-output.ts; renamed test-compact.ts -> compact-session.ts; uniform user-facing headers; fixed the silent/flaky/heavyweight examples.

Validation

lint, typecheck, typecheck:examples, test (1085 passing), build, and format:check all green.

varin-nair-factory and others added 10 commits June 12, 2026 15:38
…ptions optional

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Standardize user-facing headers (description, usage, requirements) across
all examples; rename test-compact.ts to compact-session.ts; remove
test-rewind.ts (rewind RPC unavailable in exec mode) and the duplicate
droid-dev-structured-output.ts; add a graceful FACTORY_API_KEY skip to the
daemon example; make sdk-mcp-tool.ts print tool calls/results with droid as
the default executable; harden the spec-mode-same-session permission
handler with cancel logging and a clear failure message; use cheap
conversational prompts in a temp dir for multi-turn-session.ts.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…eanup

Make the sdk-mcp-tool permission handler selective (approve only McpTool
confirmations, cancel and log otherwise); log only the rejected items in
spec-mode-same-session and note the scoping check is a demo heuristic;
add a clear readFile failure path to spec-mode-new-session; guard daemon
and session cleanup with try/finally in daemon-multi-session; correct
the list-sessions requirements note; drop the redundant compactSession
argument; reword the fork-session cleanup message.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Add required apiKey to all examples, fix streaming examples to match
default stream messages, document includePartialMessages, use real CLI
tool IDs in tool controls, trigger the permission handler with
autonomyLevel Off, type-safe structured output access, correct API
table arity, expand DroidResult/DroidSession references, remove rewind,
and refresh the examples list and doc links. All 14 code blocks
typechecked and live-verified against droid CLI.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
… flows in README

Explain that apiKey's ! only satisfies TypeScript and the droid CLI
falls back to stored credentials at runtime, note why the MCP example
needs a permissionHandler, and mark enterSpecMode() as the alternative
flow. Also trim the intro feature list, add permission-handling
anchors, code-format the droid binary name, align the functions table
return types, and tighten phrasing.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Reorganize the flat section list into grouped H2 sections with a table
of contents (Getting Started, Core Usage, Sessions, Streaming,
Controlling the Droid, MCP, Observability, Error Handling, Low-level
APIs, Configuration Reference).

Fix verified inaccuracies against droid CLI 0.146.0: gate the SDK-backed
MCP tools permissionHandler on ToolConfirmationType.McpTool (now works
after the SDK schema fix); use real exec tool IDs (read-cli, execute-cli,
grep_tool_cli, ...) and document session.listTools() for discovery;
correct MCP status reporting to summary.connected/summary.total and
servers[i].status; document addMcpServer user-level persistence plus
remove/toggle with SettingsLevel.User.

Add error-result handling (isError, subtype, errors,
structuredOutputError), permissionHandler default (cancel everything),
hooks-must-be-configured note, complete ReasoningEffort enum, reference
defaults, ResumeSessionOptions table, files/DocumentSource example,
rename/listTools/enterSpecMode coverage, and a low-level/protocol/REST
pointer. Remove the Rewind section (RPC unverifiable on current CLI).

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…on, add baseUrl)

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@varin-nair-factory varin-nair-factory merged commit ee28e4c into main Jun 16, 2026
4 checks passed
@varin-nair-factory varin-nair-factory deleted the docs/accuracy-audit branch June 16, 2026 18:41
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