Skip to content

Add live-watch newMessages#89

Merged
shaypal5 merged 2 commits into
mainfrom
codex/live-watch-new-messages
Jun 2, 2026
Merged

Add live-watch newMessages#89
shaypal5 merged 2 commits into
mainfrom
codex/live-watch-new-messages

Conversation

@shaypal5
Copy link
Copy Markdown
Contributor

@shaypal5 shaypal5 commented Jun 2, 2026

Summary

  • Add a newMessages array to agent-comms live-watch responses.
  • Populate newMessages with compact peer-only messages whose createdAt is after the watch start time, so agents can distinguish fresh arrivals from pre-existing actionable state.
  • Include newMessages on both actionable and timeout responses, with nested conversation entries in timeout latest.
  • Update agent-facing docs/help notes for the new response field.

Closes #83

Impact

This is additive to the existing live-watch response. Existing latestActionableMessage, status handling, timeout shape, and polling behavior remain compatible.

Validation

  • npm test -- --run tests/cli.test.ts
  • npm test
  • npm run check
  • npm run build

Milestone

No repo milestones are currently configured, so none was assigned.

@shaypal5 shaypal5 added the enhancement New feature or request label Jun 2, 2026
@shaypal5
Copy link
Copy Markdown
Contributor Author

shaypal5 commented Jun 2, 2026

Self-review after implementation, taking the requested outsider/senior-dev stance:

  1. The feature implementation itself is additive and preserves the existing latestActionableMessage behavior, while giving agents the missing newMessages discriminator for fresh peer messages. That is the right compatibility tradeoff for this issue.

Recommended action/fix: keep the response shape additive instead of changing live-watch exit semantics. Existing loops that wake on stale actionable state continue to work, and new loops can key off newMessages.

Applied: no behavioral change needed beyond the worker implementation.

  1. The new CLI integration tests exercise polling behavior by spawning the CLI and a fake HTTP API. Without a hard child-process timeout, a future polling regression could hang CI instead of failing cleanly.

Recommended action/fix: add a short watchdog to the CLI test helper that kills the spawned process if it fails to exit.

Applied: runCli(...) now kills the child process after 5 seconds and clears the timer on normal exit.

@shaypal5 shaypal5 merged commit a03b0d9 into main Jun 2, 2026
1 check passed
@shaypal5 shaypal5 deleted the codex/live-watch-new-messages branch June 2, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

live-watch timeout response should include messages received during the watch window

1 participant