fix(opencode): show child session prompts (#4055)

Show OpenCode child-session user prompts even when the text part has no completion timestamp.
This commit is contained in:
Matt Cowger
2026-08-31 18:35:28 +02:00
committed by GitHub
parent 74a377ff6a
commit 1694828275
3 changed files with 2 additions and 3 deletions
@@ -43,7 +43,6 @@ const cases: ProviderSubagentCase[] = [
sentinel: "OPENCODE_CHILD_SENTINEL",
expectedName: "Verify OpenCode descriptor",
expectedSubtitle: /explore · gpt-5\.4(?: · [^\n·]+)? · \d+(?:\.\d+)?k? tokens/i,
expectsUserMessage: false,
providerConfig: { model: "openai/gpt-5.4" },
prompt:
'Use the task tool exactly once with description "Verify OpenCode descriptor" and the explore subagent. Ask it to reply with exactly OPENCODE_CHILD_SENTINEL and do nothing else. Wait for it, then reply ROOT_DONE.',
@@ -6361,7 +6361,7 @@ describe("OpenCode provider subagent contract", () => {
messageID: "msg_child_prompt",
type: "text",
text: "Inspect the auth flow.",
time: { start: 1, end: 2 },
time: { start: 1 },
},
},
});
@@ -2811,7 +2811,7 @@ function appendOpenCodeTextPart(
events: AgentStreamEvent[],
): void {
if (messageRole === "user") {
if (!part.time?.end || !part.text || state.emittedUserMessageIds?.has(part.messageID)) {
if (!part.text || state.emittedUserMessageIds?.has(part.messageID)) {
return;
}
state.emittedUserMessageIds?.add(part.messageID);