mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-17 05:26:47 +03:00
test(cli-rs): compare mini shell output, record the tools filter
TS mini drops every kind "tool" commit in RunFooter.append while mini.tools is hide, the default, so a ! shell turn prints nothing. The verbosity presets gate model tools and skills in the transport; shell turns are dropped only by the footer's generic filter, a side effect. Rust keeps printing them. M.2/shell-output now sets tools: show and compares the output rows.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# M07, M13: `!` shell turns show while `tools` is `hide`
|
||||
|
||||
TypeScript: `RunFooter.append` (`packages/tui/src/mini/footer.ts:606`) drops every commit that
|
||||
`toolTranscript` (`footer.ts:1176-1178`) matches, `kind === "tool"`, while `mini.tools` is `hide`. That is the
|
||||
default (`verbosity.ts:17-23`). A `!` shell turn's commits are `shellCommit`s, `kind: "tool"`
|
||||
(`stream-v2.transport.ts:340-353`), so at the default verbosity TS prints neither `$ <command>` nor the output:
|
||||
the user's own command leaves no row in the scrollback. In `parity/scenarios/M.2/shell-output.pty.ts` with the
|
||||
default settings, TS shows no shell rows after the turn ends, after 4 s more, or after another key; with
|
||||
`tools: "show"` it shows them as soon as the turn ends.
|
||||
|
||||
Rust: mini prints the `!` shell turn (`$ <command>`, its output, and the exit error) whatever `tools` is.
|
||||
|
||||
Reason: the `tools` filter came with the verbosity presets (#47931), which gate model tool calls and skills in
|
||||
the transport (`showTools()`), and whose "Tools" setting names "files skills activity work steps". Shell turns
|
||||
are not gated there; they are dropped only by the footer's generic filter. `runShellTurn` even holds the turn
|
||||
up to 1.5 s "so the output commit renders inside it" (`stream-v2.transport.ts:395-398`). Hiding a command the
|
||||
user typed is a side effect, not the intent. With `tools: "show"` the two clients print the same rows, so the
|
||||
scenario sets it and compares the output.
|
||||
@@ -62,15 +62,15 @@ export default definePty({
|
||||
setup: async (root) => {
|
||||
await Bun.write(
|
||||
`${root}/home/.config/opencode/cli.json`,
|
||||
JSON.stringify({ animations: false, mini: { splash: "hide" } }),
|
||||
// TS hides `!` shell turns while `tools` is `hide`, the default (`M07-mini-shell-tools.md`).
|
||||
JSON.stringify({ animations: false, mini: { splash: "hide", tools: "show" } }),
|
||||
)
|
||||
},
|
||||
steps: [
|
||||
opened,
|
||||
{ keys: "!echo hello", settle: 300 },
|
||||
{ keys: "\r", settle: 400, checkpoint: "waiting" },
|
||||
// The shell's output entry is not compared: TS holds it back past this scenario.
|
||||
{ until: { screen: /^build · model · demo/m }, settle: 400 },
|
||||
{ until: { screen: /^build · model · demo/m }, settle: 400, checkpoint: "output", scrollback: 4 },
|
||||
...leave,
|
||||
],
|
||||
exits: true,
|
||||
|
||||
Reference in New Issue
Block a user