Skip to content

Add live stream-json idle events and contract docs#274

Merged
konard merged 2 commits into
mainfrom
issue-273-d5676a1f4939
Jul 3, 2026
Merged

Add live stream-json idle events and contract docs#274
konard merged 2 commits into
mainfrom
issue-273-d5676a1f4939

Conversation

@konard

@konard konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Emit a public session_idle event when a session reaches a turn boundary and map it to Claude stream-json as idle.
  • Use the shared bus event output path from continuous stdin mode so live drivers get the same session, permission, error, and idle events as single-message JSON mode.
  • Document the live stream-json contract for hive-mind style drivers: stdin frames, resume/no-fork behavior, user-frame replay acknowledgements, interrupts, queueing, and idle boundaries.
  • Add a changeset for the patch release.

Reproduction

Before this change, session.idle only resolved the internal wait promise. A driver using --input-format stream-json --output-format stream-json could see user-frame replay and result events, but had no explicit public turn-boundary event to know when queued input could safely be flushed.

The new js/tests/event-handler.js reproduces that gap by publishing SessionStatus.Event.Idle and asserting a public session_idle output is produced.

Tests

  • cd js && bun test ./tests/event-handler.js ./tests/json-standard-unit.js ./tests/input-queue.js
  • cd js && npm run check
  • cd js && npm test (600 pass, 4 todo)
  • node scripts/validate-changeset.mjs

Fixes #273

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #273
@konard konard self-assigned this Jul 3, 2026
@konard konard changed the title [WIP] Live input for hive-mind: document session resume/steer semantics (follow-up to #268) Add live stream-json idle events and contract docs Jul 3, 2026
@konard konard marked this pull request as ready for review July 3, 2026 15:52
@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Implemented and pushed the fix to issue-273-d5676a1f4939.

PR 274 is ready for review: #274

What changed:

  • Added public session_idle output and Claude stream-json idle mapping.
  • Shared the bus event output path with continuous stdin mode.
  • Documented live stream-json resume, replay, interrupt, queueing, and idle semantics.
  • Added regression coverage and a patch changeset.
  • Removed the generated .gitkeep placeholder.

Verification:

  • cd js && bun test ./tests/event-handler.js ./tests/json-standard-unit.js ./tests/input-queue.js
  • cd js && npm run check
  • cd js && npm test 600 pass, 4 todo
  • node scripts/validate-changeset.mjs
  • GitHub CI run 28671028299 passed on commit f5c3a3c.

This summary was automatically extracted from the AI working session output.

@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $13.333963

📊 Context and tokens usage:

  • 426.8K / 200K (213%) input tokens, 31.9K / 128K (25%) output tokens

Total: (426.8K + 7.6M cached) input tokens, 31.9K output tokens, $13.333963 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Thinking level: max (~31999 tokens)
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (5263KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 76f5ec4 into main Jul 3, 2026
9 checks passed
@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live input for hive-mind: document session resume/steer semantics (follow-up to #268)

1 participant