Repository navigation
Gotchas
github-actions[bot] edited this page Nov 1, 2026
·
1 revision
The rules agents and humans get wrong most often, one line each with the page that explains it.
- Read a run's channel until it closes;
Runalways returns a nil error, failures arrive asEventErrorplusEventEnd. Agent - Share one
Historyand oneLockeracross allSessionvalues of the process; aLockerper session serializes nothing. Agent -
NewLocalSessionkeeps History in memory: a restart loses every conversation. Agent - History changes only on
stopandmax_turns; aftererror,timeoutorcancelledit is as before the run, but files the tools wrote stay written. Agent - There is no way to rewind History; make runs reversible with an overlay and
Commitafter success. Files -
RunWithMessagesnever touches History; persistDrain's messages yourself. Agent - On
EventToolResult,ToolResult.Contentis the full result,ModelContentthe capped JSON the model saw; storeModelContent(asDraindoes) to replay what the model saw. Agent - All
EventToolCalls of one model reply arrive before the first tool runs, then theEventToolResults follow in the same order; pair them byToolResult.CallID, not by position. Agent - Negative
RunTimeoutorLLMCallTimeoutis an error; negativeToolCallTimeoutorMaximumToolResultBytesdisables the cap. Agent - Prompt caching is on by default and adds
Cacheto the request, never to History; a message that already has a breakpoint switches the automatic ones off. Agent -
llm/codexcannot run tools: an agent session over a Codex client fails as soon as tools are offered. Models
- The default tool set has ten names; a host that guards tool names must know
grep,glob,edit_file,multi_edit,move_file, or setDisableExtended. Tools -
searchexists only for avfs.Searchablestore;todo_writeonly afterRegisterPlanTool. Tools -
read_fileprefixes lines with their number and a tab;edit_filewantsold_stringwithout that prefix. Tools -
AllowedExtensionsalso refuses reads of other files, not only writes. Tools -
Dispatchchecks only required top-level fields; parse and validate the rest in the handler. Tools - A handler error is shown to the model: write it as an instruction, and never put secrets in it. Tools
- Handlers that ignore
ctxare not stopped byToolCallTimeout. Security
-
vfs/osfsneedsClose;osfs.Newfails for a directory that does not exist. Files -
osfsdoes not store content types; they come from the extension. Files - An overlay over a read-only base fails at
Commit, not atWriteFile. Files -
Commitstops at the first failing path; earlier paths are already written, the rest stays pending. Files -
mount.Newreturnsvfs.Storage, not a concrete type, soSearchableis present only when a mount can search. Files - A path equal to a mount prefix (
docs) is invalid; files live below it (docs/a.md). Files -
embedfsover//go:embed dir/*needsfs.Sub(corpus, "dir"), or every path starts withdir/. Files
- Use
Complete, notStreamorCollect, for image output: a base64 image exceeds the SSE line cap. Media -
openai/gpt-image-2.5-flareand other images-endpoint models answer only onGenerateImage, and are missing fromModels. Media - Set
ImageRequest.SizeorAspectRatio+ImageSize, never both. Media - Video and decision models take only the values their lists name (
VideoModels,DecisionModels); everything else is rejected, nothing is snapped. Media -
SpeechResponsehas no usage: price speech per character. Media -
WithProviderreplaces the client's provider preferences, it does not merge them. Models -
Streamretries only before the first byte; useCollectWithRetryto restart a whole stream, and pay for every attempt. Errors-and-Retry - Match errors with
errors.Is/errors.As, never by text. Errors-and-Retry - One Codex
TokenSourceper login and process; a reused refresh token revokes the login. Models - Keep example sentences out of
TranscribeRequest.Hint; a silent clip repeats them. Media
-
aikido agent --diris a dry run; only--applywrites, and only when the run ended withstop: after an error, timeout, cancel or the turn cap it prints the changes, writes nothing and exits non-zero. CLI - An explicit
-mimage model is never switched for a frame it cannot render; the CLI errors instead. CLI
Mirror of docs/wiki at v1.2.0 (dd94d84). Edit the repository, not this wiki.