GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [FEATURE] opencode run: expose child session events (subtask_event/subtask_delta) in NDJSON stream · Issue #33397 · anomalyco/opencode Closed as not planned Closed as not planned Copy link DescriptionProblemWhen using This makes We investigated every alternative:
Root CauseIn if (event.type === "message.part.updated") { const part = event.properties.part if (part.sessionID !== sessionID) continue // ← drops all child session events Child session events ( The child Proposed SolutionA minimal, additive change to 1. Track child session IDs as tasks start: const childSessionIDs = new Set<string>() // inside the message.part.updated block, before the sessionID filter: if (part.type === "tool" && part.tool === "task" && part.state.status === "running") { const meta = part.state.metadata as { sessionId?: string } | undefined if (meta?.sessionId) childSessionIDs.add(meta.sessionId) } 2. Forward child events with an envelope instead of dropping them: if (part.sessionID !== sessionID) { if (childSessionIDs.has(part.sessionID)) { emit("subtask_event", { childSessionID: part.sessionID, part }) } continue } 3. Forward streaming deltas from child sessions: if (event.type === "message.part.delta") { if (childSessionIDs.has(event.properties.sessionID)) { emit("subtask_delta", { childSessionID: event.properties.sessionID, partID: event.properties.partID, delta: event.properties.delta, }) } } This produces new NDJSON event types in {"type":"subtask_event","sessionID":"ses_parent","childSessionID":"ses_child","part":{"type":"tool","tool":"bash",...}}
{"type":"subtask_delta","sessionID":"ses_parent","childSessionID":"ses_child","partID":"p_1","delta":"Analyzing"}
{"type":"subtask_delta","sessionID":"ses_parent","childSessionID":"ses_child","partID":"p_1","delta":" the code"}
{"type":"subtask_event","sessionID":"ses_parent","childSessionID":"ses_child","part":{"type":"text","text":"Done.",...}}Why This Matters
With this change, Additional Notes
We are happy to contribute the patch if the direction is approved. /cc @cHIsIMun Reacted by lotuc Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |