stub

command
v0.4.2-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command modelstub is a scripted, deterministic stand-in for the model endpoint, so that the two-machine harness in internal/e2e/remote_test.go can drive a REAL turn without an API key and without a network.

WHY A STUB AND NOT A REAL MODEL. The thing under test is the wire between two filesystems, not the model's judgment. A real model would make every scenario probabilistic — a path assertion that fails because the model chose to paraphrase instead of quoting is a false red — and it would put a bill and a credential in front of a test whose whole point is that anybody can run it. So this speaks OpenRouter's OpenAI-compatible dialect exactly as internal/provider writes and reads it (client.go's `<base>/chat/completions`, sse.go's chunk shape, catalog.go's `<base>/models?output_modalities=all`) and answers from a script.

THE SCRIPT IS KEYED OFF THE PERSON'S OWN WORDS. Every scenario submits a message carrying one of the markers below, and this server answers the way that scenario needs — including calling a tool, so the engine machine does real work on its own disk and the reply can be checked against it.

PROBE-ECHO         one reply, no tools: the handshake and one turn
PROBE-PWD          calls `bash` with `pwd`, then quotes the answer back
PROBE-READ <path>  calls `read` on the path, then quotes the answer back
PROBE-SLOW         a reply spread over seconds, for the link that dies
PROBE-NOCHANGE <path> replays the completion-check rejection from #1065

QUOTING THE TOOL OUTPUT BACK IS THE WHOLE TRICK. `--once` prints the model's reply on stdout and the tool's own output nowhere at all, so a scenario that wants to assert on what a tool SAW has to have the reply carry it. A real model would summarize; this one echoes verbatim, which is what makes an assertion about an absolute path possible at all.

STDERR IS THE LOG. Every request is one line, so `docker logs` on the model container answers "did the turn ever reach the model, and what did it ask".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL