@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test"
22import { InstallationVersion } from "@opencode-ai/core/installation/version"
33import path from "node:path"
44import { mergeInteractiveInput , mergeNonInteractiveInput , parseRunModel , pickRunModel } from "../src/mini"
5- import { toolInlineInfo , toolView } from "../src/mini/tool"
5+ import { toolInlineInfo , toolOutputText , toolView } from "../src/mini/tool"
66
77async function cli ( args : string [ ] ) {
88 const child = Bun . spawn ( [ process . execPath , "run" , "src/index.ts" , ...args ] , {
@@ -36,6 +36,24 @@ describe("mini command", () => {
3636 expect ( toolInlineInfo ( part ) ) . toMatchObject ( { icon : "$" , title : "pwd" , mode : "block" } )
3737 } )
3838
39+ test ( "uses non-empty V2 shell output without the model-facing status" , ( ) => {
40+ expect (
41+ toolOutputText ( "shell" , [
42+ { type : "text" , text : "mini-output\n" } ,
43+ { type : "text" , text : "Command exited with code 0." } ,
44+ ] ) ,
45+ ) . toBe ( "mini-output\n" )
46+ } )
47+
48+ test ( "keeps empty V2 shell output empty" , ( ) => {
49+ expect (
50+ toolOutputText ( "shell" , [
51+ { type : "text" , text : "" } ,
52+ { type : "text" , text : "Command exited with code 0." } ,
53+ ] ) ,
54+ ) . toBe ( "" )
55+ } )
56+
3957 test ( "uses piped stdin as the initial prompt" , ( ) => {
4058 expect ( mergeInteractiveInput ( "from stdin" , undefined ) ) . toBe ( "from stdin" )
4159 expect ( mergeInteractiveInput ( "from stdin" , "from flag" ) ) . toBe ( "from stdin\nfrom flag" )
0 commit comments