Skip to main content

Module instructions

Module instructions 

Source
Expand description

What the model is told before the conversation: who it is working for, where, and with which tools, followed by the folder’s own AGENTS.md when it has one.

Constants§

AGENTS_FILE
The name of the file a folder keeps its instructions for coding agents in.
REQUEST_CAP
The most a request may be, in bytes: the conversation, the system prompt and the tools together. Four bytes to a token is a good rough count of plain text, so this is about sixty five thousand tokens of input, which fits a hundred and twenty eight thousand token context with this crate’s reply still allowed. A real conversation is far below it, so a normal day is sent byte for byte as it always was; a morning of work in a real folder is not, and without a limit that size is paid for again on every single turn, and a provider that refuses a request too long says so only in an error in the corner.

Functions§

agents
The folder’s AGENTS.md, when it has one that can be read as text.
body
The body of the next request: the conversation as far back as REQUEST_CAP allows, the system prompt and the tools.
body_within
The body of a request that is at most cap bytes: the conversation trimmed to what is left of cap once the rest of the body is counted in, that rest, and nothing else. body is this with REQUEST_CAP; a cap of usize::MAX sends the conversation as it is kept, which is what the trimmed request is measured against.
system
The system prompt for work in root.