kimi-cli / tests_e2e
AGENTS.md11k starsChanged 41 days agoApache-2.0Archived repositoryView on GitHub
Prompt and Event Stream - W-07 Basic turn: TurnBegin/StepBegin/ContentPart(text)/StatusUpdate flow. - W-08 Multiline input: TurnBegin.userinput preserves newlines. - W-09 Content parts input: userinput as ContentPart[] (text/image/audio/video) with capabilities enabled. - W-10 Thinking toggle: --thinking emits ContentPart(type=think), --no-thinking does not (real LLM). - W-11 Concurrent prompt: second prompt returns -32000 (turn already in progress). - W-12 Cancel turn: cancel returns {}, original prompt becomes status=cancelled (may emit StepInterrupted, real LLM). Tools and Approvals - W-13 Shell approval: Shell triggers ApprovalRequest, approve…
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 4
Test only kimi --wire JSON-RPC + wire messages.
- Very specific: line 5
Do not test --agent okabe.
- Distinctive: line 6
Do not test: W-23, W-26, W-29, W-27 (env overrides).
- Very specific: line 11
Always isolate HOME, USERPROFILE, and KIMI_SHARE_DIR, and use a temporary --work-dir to avoid touching real ~/.kimi.
- Very specific: line 13
Use inline_snapshot for snapshot testing.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
tests_e2e Wire E2E Guide
Goals and Scope
- Test only
kimi --wireJSON-RPC + wire messages; no Shell UI/Print/ACP/Term/shortcuts. - Do not test
--agent okabe. - Do not test: W-23, W-26, W-29, W-27 (env overrides).
Execution Rules
- Tests run via
uv run kimiby default; setKIMI_E2E_WIRE_CMDto override the base command (e.g.../kimi-agent-rs/target/debug/kimi-agentorkimi-agenton PATH).--wireis appended if missing. - Always isolate
HOME,USERPROFILE, andKIMI_SHARE_DIR, and use a temporary--work-dirto avoid touching real~/.kimi. - Use
inline_snapshotfor snapshot testing; snapshots can start empty and be updated later. - Wire traffic is line-delimited JSON;
event/request/responses may interleave.
Test Matrix
Startup and Protocol
- W-01 Handshake:
initializereturnsprotocol_version=1.1,server, and non-emptyslash_commands. - W-02 External tool registration and call: register
external_tools, trigger aToolCallRequest, returnToolResult, turn finishes. - W-03 External tool conflict: registering a tool name that conflicts with a built-in is rejected with a reason.
- W-04 Prompt without handshake: send
promptwithoutinitialize, turn still completes. - W-05 LLM not set: missing config yields
-32001(LLM is not set). - W-06 Max steps: set a tiny
--max-steps-per-turn, response isstatus=max_steps_reached.
Prompt and Event Stream
- W-07 Basic turn:
TurnBegin/StepBegin/ContentPart(text)/StatusUpdateflow. - W-08 Multiline input:
TurnBegin.user_inputpreserves newlines. - W-09 Content parts input:
user_inputasContentPart[](text/image/audio/video) with capabilities enabled. - W-10 Thinking toggle:
--thinkingemitsContentPart(type=think),--no-thinkingdoes not (real LLM). - W-11 Concurrent prompt: second
promptreturns-32000(turn already in progress). - W-12 Cancel turn:
cancelreturns{}, originalpromptbecomesstatus=cancelled(may emitStepInterrupted, real LLM).
Tools and Approvals
- W-13 Shell approval:
ShelltriggersApprovalRequest,approveyieldsToolResult. - W-14 Approval reject:
rejectends turn; tool does not run. - W-15 Session approval:
approve_for_sessionremoves subsequent blocking approvals. - W-16 YOLO:
--yoloskips blocking approvals. - W-17 DisplayBlock coverage:
Shell/WriteFile/StrReplaceFile/SetTodoListemit expected display types. - W-18 Tool args streaming:
ToolCallPart.arguments_partcan be stitched into full args.
Sessions and Context
- W-19 Session files:
--session <id>writescontext.jsonlandwire.jsonl. - W-20 Continue session:
--continueappends to the same session files. - W-21 Clear context:
/clearensures the nextpromptdoes not rely on prior context. - W-22 Manual compaction:
/compacttriggersCompactionBegin/CompactionEnd. - W-24 Status stats:
StatusUpdate.context_usage/token_usagetypes are valid and change over time.
Config and Runtime Flags
- W-25
--configinline: JSON/TOML string config works. - W-28 CLI override:
--modeloverridesdefault_model. - W-30 Work dir:
promptasks "where is the current directory", verify--work-dir(real LLM).
Extensions (Agents/Skills/MCP)
- W-31 Built-in agent boundary:
defaultcallingSendDMailfails or is rejected. - W-32 Custom agent:
--agent-fileexcludes tool and calls are rejected. - W-33 Subagents: prompt "parallel call two task tools, each runs shell sleep 0.5 and 1 second"; verify Task/SubagentEvent streaming/ToolResult/multiple approvals (real LLM).
- W-34 Skill call: create a test skill,
/skill:testinjectsSKILL.md(wire has no/help). - W-35 Flow skill:
/flow:<name>runs the flow untilEND. - W-36 MCP: use a Python fastmcp test server, load via
--mcp-config-file, verify tool works.
Resilience and Errors
- W-37 Invalid JSON: malformed JSON line returns
-32700. - W-38 Invalid request: missing fields returns
-32600. - W-39 Unknown method: returns
-32601. - W-40 Invalid params: bad structure returns
-32602. - W-41 Cancel without active turn: returns
-32000. - W-42 LLM errors: unsupported model
-32002and service error-32003.
Real LLM Placeholders
- W-10/W-12/W-30/W-33 require a real provider; everything else uses
_scripted_echo.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- codex-workerSkill
- feature-smoke-testSkill
- gen-changelogSkill
- gen-docsSkill
- gen-rustSkill
- pull-requestSkill
- releaseSkill
- translate-docsSkill
- worktree-statusSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

