Skip to content

fix(agent): preserve stream parent relationship#878

Open
agent-p1p wants to merge 1 commit into
masterfrom
pip/mdk-876
Open

fix(agent): preserve stream parent relationship#878
agent-p1p wants to merge 1 commit into
masterfrom
pip/mdk-876

Conversation

@agent-p1p

@agent-p1p agent-p1p commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an optional parent_message_id_hex to stream_begin while preserving omitted-field wire compatibility
  • validate and emit the parent message ID on kind-1200 stream-start events
  • propagate the triggering inbound message ID through the Hermes and OpenClaw live-preview pipelines
  • document the durable reply-chain fix in the unreleased changelog

Verification

  • just fast-ci
  • cargo test -p agent-control
  • cargo test -p agent-connector
  • cargo test -p marmot-app
  • python3 -m unittest discover -s integrations/hermes/marmot/tests
  • OpenClaw TypeScript typecheck and Vitest suite

Fixes #876


Open in Stage

Thread the triggering prompt message ID through stream_begin and emit it on kind-1200 start events. Keep the field optional for existing callers and wire clients.

Fixes #876
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@agent-p1p, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7eec05d1-84b3-47c8-b1f6-a0c16880e42c

📥 Commits

Reviewing files that changed from the base of the PR and between 363b1fe and 79e6791.

📒 Files selected for processing (18)
  • crates/agent-connector/src/connection.rs
  • crates/agent-connector/src/stream.rs
  • crates/agent-connector/src/tests.rs
  • crates/agent-control/src/lib.rs
  • crates/cli/CHANGELOG.md
  • crates/marmot-app/src/client/mod.rs
  • crates/marmot-app/src/messages/intents.rs
  • crates/marmot-app/src/runtime/account_worker.rs
  • crates/marmot-app/src/runtime/commands.rs
  • crates/marmot-app/src/runtime/mod.rs
  • crates/marmot-app/src/tests.rs
  • integrations/hermes/marmot/adapter.py
  • integrations/hermes/marmot/tests/test_adapter.py
  • integrations/openclaw/marmot/src/client.ts
  • integrations/openclaw/marmot/src/dispatch.ts
  • integrations/openclaw/marmot/src/live.ts
  • integrations/openclaw/marmot/test/client.test.ts
  • integrations/openclaw/marmot/test/dispatch.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pip/mdk-876

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@stage-review

stage-review Bot commented Jul 15, 2026

Copy link
Copy Markdown

@agent-p1p agent-p1p left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review at exact head 79e67911290d40f73a5585a522a2006532bf4cbe.

BLOCKING:

  • none

SUGGESTION:

  • none

NITPICK:

  • none

SUMMARY: The change is well-scoped and completes the durable chain final --stream-start--> start --parent--> triggering prompt. The optional control-protocol field remains wire-compatible when omitted; the connector and app intent enforce a 32-byte message ID before emitting the kind-1200 parent tag; Hermes copies the inbound inner-event ID into the spawned task context used by draft streaming; and OpenClaw passes the same inbound messageIdHex already used by its durable reply path. The connector projection test verifies the emitted tag, and both host integrations cover populated and omitted propagation. No correctness, security/privacy, or unnecessary-complexity blocker found.

Verification:

  • cargo test -p agent-control — 13 passed
  • cargo test -p agent-connector connector_socket_composes_and_finalizes_stream — 1 passed
  • cargo test -p marmot-app stream_start_intent_ — 4 passed
  • python3 -m unittest discover -s integrations/hermes/marmot/tests — 88 passed
  • OpenClaw typecheck — passed
  • OpenClaw Vitest — 198 passed, 1 skipped
  • GitHub CI — all required jobs green

Follow-up: filed #879 for the pre-existing pnpm-workspace.yaml configuration that makes plain pnpm typecheck / pnpm test fail. It is unrelated to #876; the scripts pass with --ignore-workspace.

VERDICT: APPROVE. This is an approve-equivalent COMMENTED review because agent-p1p authored the PR and cannot formally approve its own PR.

SENSITIVE_PATHS: crates/agent-control/** and crates/agent-connector/** are sensitive under the repository rubric. Recorded for the merge gate; not a review blocker.

@agent-p1p

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

Agent text stream starts omit parent prompt relationship

1 participant