You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Opencode2 inside subagent pos1 and end shortcut dont work #60727
Thanks for the report! I reproduced this on the latest release (2.2.4) and it still happens on the latest dev (171dbd6). ("Pos1" is Home.)
What I did, using a simulated model:
Started a session where the model runs a subagent that writes a long answer, and the parent then replies with a long answer too.
In the main session, Home jumps to the first message as expected.
Opened the subagent's session from the subagent picker and pressed Home, PageUp and Ctrl+G. The view stays at the bottom and none of them move the transcript.
The recording and screenshots below show it, and the script below reproduces it.
The likely cause: in a subagent session the Subagents panel is always open. While it is open, the keys that move the transcript (Home/End, PageUp/PageDown, Ctrl+G) seem to be switched off.
recording.mp4
Reproduction script (drive.ts)
// Repro for anomalyco/opencode#60727: Home/End (and PageUp) do not navigate the transcript inside a subagent session.import{Effect,Stream}from"effect"import{Llm,OpenCodeDriver}from"opencode-drive"constscreenText=(ui: {capture: ()=>Effect.Effect<{lines: ReadonlyArray<{spans: ReadonlyArray<{text: string}>}>},unknown>})=>ui.capture().pipe(Effect.map((f)=>f.lines.map((l)=>l.spans.map((s)=>s.text).join("")).join("\n")))constshows=(text: string,needle: RegExp)=>needle.test(text)constlines=(prefix: string)=>Array.from({length: 40},(_,i)=>`${prefix} line ${i+1}`).join("\n\n")exportdefaultOpenCodeDriver.use({
...(process.env.OC_DEV ? {opencode: {dev: process.env.OC_DEV}} : {}),tui: {recording: true,keypressOverlay: true,viewport: {cols: 120,rows: 40}},},({ ui, llm })=>Effect.gen(function*(){yield*llm.serve((request)=>{constbody=request.bodyas{tools?: unknown[]}consts=JSON.stringify(body)if(!Array.isArray(body.tools)||body.tools.length===0)returnStream.make(Llm.text("Repro session"))if(s.includes("call_sub"))returnStream.make(Llm.text(lines("Parent")+"\n\nAll done."))if(s.includes("Delegate to a subagent"))returnStream.make(Llm.toolCall({index: 0,id: "call_sub",name: "subagent",input: {agent: "general",description: "Long child answer",prompt: "Write 40 lines"},}),Llm.finish("tool-calls"),)if(s.includes("Write 40 lines"))returnStream.make(Llm.text(lines("Child")+"\n\nChild END"))returnStream.make(Llm.text("unexpected"))})yield*ui.submit("Delegate to a subagent")yield*Effect.sleep(8000)yield*ui.waitFor("All done",{timeout: 90000})// Parent session: Home jumps to the first messageyield*ui.press("home")yield*Effect.sleep(800)yield*ui.screenshot("parent-after-home")yield*Effect.log(`PARENT: Home shows 'Parent line 1': ${shows(yield*screenText(ui),/Parentline1\b/)}`)yield*ui.press("end")yield*Effect.sleep(800)// Open the subagent session via the pickeryield*ui.press("down")yield*Effect.sleep(500)yield*ui.press("a",{ctrl: true})// show inactive (completed) subagentsyield*Effect.sleep(500)yield*ui.enter()yield*Effect.sleep(3000)// child session opens at its bottom (Child END)yield*Effect.sleep(800)yield*ui.screenshot("child-before-home")yield*ui.press("home")yield*Effect.sleep(1000)yield*ui.screenshot("child-after-home")yield*Effect.log(`CHILD: Home shows 'Child line 1': ${shows(yield*screenText(ui),/Childline1\b/)}`)yield*ui.press("pageup")yield*Effect.sleep(800)yield*ui.screenshot("child-after-pageup")yield*Effect.log(`CHILD: PageUp shows 'Child line 7': ${shows(yield*screenText(ui),/Childline7\b/)}`)yield*ui.press("g",{ctrl: true})yield*Effect.sleep(800)yield*ui.screenshot("child-after-ctrl-g")yield*Effect.log(`CHILD: ctrl+g shows 'Child line 1': ${shows(yield*screenText(ui),/Childline1\b/)}`)}),)
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.
I'll take a look at this with a renderer regression test for child-session transcript navigation, keeping the subagent picker bindings intact. Using Codex for the investigation and patch.
Activity
opencodejr commentedon Oct 30, 2026
Thanks for the report! I reproduced this on the latest release (2.2.4) and it still happens on the latest
dev(171dbd6). ("Pos1" is Home.)What I did, using a simulated model:
The recording and screenshots below show it, and the script below reproduces it.
The likely cause: in a subagent session the Subagents panel is always open. While it is open, the keys that move the transcript (Home/End, PageUp/PageDown, Ctrl+G) seem to be switched off.
recording.mp4
Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH; setOC_DEVto the path of an OpenCode checkout to run that from source instead.ricky9408 commentedon Oct 31, 2026
I'll take a look at this with a renderer regression test for child-session transcript navigation, keeping the subagent picker bindings intact. Using Codex for the investigation and patch.