Expand description
Deterministic, offline “echo” LLM client for #2056’s mandatory offline testability (no live model, no API key).
Why: task execution needs a live LLM in production, but the e2e/CI suite
must exercise the FULL flow (create -> attach -> run -> live tool events
-> done) without one. Setting TCODE_MOCK_LLM=echo (checked by
build_llm_client) swaps this deterministic client in for the real
LlmClient — the daemon still starts and serves ping/health/
session.* fine with neither set; only task.run needs one or the
other.
What: EchoLlmClient replays a FIXED script exercising exactly the
shape #2056 wires: the PM delegates once to python-engineer, which
runs one bash tool call then stops, after which the PM sees the result
and stops too. This is production code (not #[cfg(test)]) because the
REAL tcode binary, spawned as a subprocess in tests/task_e2e.rs, must
be able to construct it with no test harness in scope.
Test: task::mock_llm::tests::*; exercised end-to-end (as a real
subprocess) by tests/task_e2e.rs.
Structs§
- Echo
LlmClient - A deterministic, scripted
InferenceAdapterfor offline task-execution testing (#2056). - Fanout
Echo LlmClient - A deterministic, scripted
InferenceAdapterexercising a FAN-OUT to two concurrently-delegatedpython-engineersub-agents (DOC-39 AC-13’s acceptance proof). - Recall
Echo LlmClient - A deterministic, scripted
InferenceAdapterexercising the PM callingrecall_session(DOC-39 Slice C’s e2e proof). - Search
Echo LlmClient - A deterministic, scripted
InferenceAdapterexercising the engineer’ssearch_codetool (DOC-39 Slice B’s mandatory real-wire e2e proof thatEvent::SearchPerformed.hitscarries real per-hit path/score data, not just a count). - Soak
Echo LlmClient - A deterministic, offline
InferenceAdapterfor issue #3869’s compression-effectiveness soak harness (epic #3866 Slice C). - Soak
Load Echo LlmClient - A deterministic, offline
InferenceAdapterdriving load-realistic per-turn payload sizes for the compression-effectiveness follow-up soak (epic #3866).
Constants§
- MOCK_
LLM_ ECHO - The
TCODE_MOCK_LLMvalue that selectsEchoLlmClient. - MOCK_
LLM_ ECHO_ FANOUT - The
TCODE_MOCK_LLMvalue that selectsFanoutEchoLlmClient(DOC-39 AC-13). - MOCK_
LLM_ ECHO_ RECALL - The
TCODE_MOCK_LLMvalue that selectsRecallEchoLlmClient(DOC-39 Slice C). - MOCK_
LLM_ ECHO_ SEARCH - The
TCODE_MOCK_LLMvalue that selectsSearchEchoLlmClient(DOC-39 Slice B). - MOCK_
LLM_ ECHO_ SOAK - The
TCODE_MOCK_LLMvalue that selectsSoakEchoLlmClient(issue #3869, epic #3866 Slice C). - MOCK_
LLM_ ECHO_ SOAK_ LOAD - The
TCODE_MOCK_LLMvalue that selectsSoakLoadEchoLlmClient(epic #3866’s load-realistic follow-up soak). - MOCK_
LLM_ ENV - Environment variable selecting the mock LLM. Set to
MOCK_LLM_ECHOto enableEchoLlmClientinstead of a real OpenRouter client.
Functions§
- build_
llm_ client - Build the
Arc<dyn InferenceAdapter>task.runexecutions share.