docs: accuracy audit of README, guides, and examples (+2 SDK fixes)#66
Merged
Conversation
…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>
factory-ain3sh
approved these changes
Jun 16, 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.
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
proceed_always_tools). Schemas now accept unknown values forward-compatibly. (ccf25e1)resumeSession(id)crashed with one argument and stripped an ambientFACTORY_API_KEY. Options are now optional and ambient env is preserved. (8140fa4)Both include regression tests.
Documentation corrections (all examples re-verified live)
apiKeyto every example with the stored-credentials nuance; fixed 7 deadAssistantTextDeltasnippets (default stream needsincludePartialMessages); fixedunknownstructuredOutputaccess; permission example now sets autonomy so the handler actually fires; real CLI tool IDs; removed the false "allowlist" claim; updated examples list; removed rewind.MachineType.Ephemeral; expanded theDaemonSessionmethod list; prominent "apiKey strictly required, no fallback" note; added TOC; corrected an export claim and tool-id wording.test-rewind.tsand the duplicatedroid-dev-structured-output.ts; renamedtest-compact.ts->compact-session.ts; uniform user-facing headers; fixed the silent/flaky/heavyweight examples.Validation
lint,typecheck,typecheck:examples,test(1085 passing),build, andformat:checkall green.