[codex] Wire OpenClaw queue hooks into bridge - #77
Conversation
Ship example 09 (RPC smoke + live block via chat.send), runtime weave tests, and scripts/docs for OpenClaw fork 1:1 alignment with queue hook validation. Co-authored-by: Cursor <cursoragent@cursor.com>
Wire command.output_stream, patch.summary_created, and error.detected via runtime observers; add live queue rewrite dogfood scripts and docs. Co-authored-by: Cursor <cursoragent@cursor.com>
Fix ruff format on queue weave tests; document decision vs observe paths; add fork hook backlog; bind before_agent_run observe; expand bridge checklist. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89256b1292
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!isQueueTarget(row.target) && !BLOCK_MODES.has(row.mode)) continue; | ||
|
|
||
| if (BLOCK_MODES.has(row.mode)) { | ||
| decision.block = true; |
There was a problem hiding this comment.
Restrict queue vetoes to queue-scoped advice targets
The queue guard currently blocks enqueue on any block/suppress/escalate row, even when the advice target is not queue.*. With the current predicate, a concern matching queue.before_enqueue that contains a non-queue blocking advice (for example, a runtime prompt target) will still set block: true and drop the follow-up enqueue. This is broader than the documented queue mapping and can cause unintended queue drops when mixed-target advice is present.
Useful? React with 👍 / 👎.
| case "patch": | ||
| return { | ||
| name: "patch.summary_created", | ||
| payload: { run_id: evt.runId, stream: evt.stream, ...data }, |
There was a problem hiding this comment.
Emit patch.summary_created only for summary-phase patch events
This maps every stream: "patch" agent event to patch.summary_created without checking whether a summary was actually produced. If the patch stream emits non-summary phases (e.g., start/delta/update events), pointcuts and DCN activations tied to patch.summary_created will fire early and multiple times, which mislabels the lifecycle and can trigger policies on incomplete patch output.
Useful? React with 👍 / 👎.
Summary
queue_before_enqueue/queue_after_enqueueinto the bridge asqueue.before_enqueue/queue.after_enqueuewith sync block and prompt/summary rewrite (queue_guard).gateway call chat.send), fork alignment scripts, and runtime weave tests.onAgentEvent:command.output_stream,patch.summary_created,error.detected; bindbefore_agent_runobserve oninput.received.allowConversationAccess, fork 1:1).Commits (4)
feat: wire OpenClaw queue hooks into bridge— bridge + runtime catalogdocs: add queue hook dogfood example and fork dev helpersfeat(bridge): emit observe joinpoints from agent eventschore: bridge-only plan wrap-up— ruff format, docs,before_agent_runobserveTest plan
cd integrations/openclaw-opencoat-bridge && npm testuv run python -m pytest -q packages/opencoat-runtime/tests/core/test_joinpoint_aliases.py packages/opencoat-runtime/tests/core/test_queue_joinpoint_weave.pyuv run ruff format --check .(fixes format ontest_queue_joinpoint_weave.py)./scripts/check-openclaw-fork.sh./examples/09_queue_hook_dogfood/scripts/smoke-rpc.sh all./examples/09_queue_hook_dogfood/scripts/live-queue-block-test.sh./examples/09_queue_hook_dogfood/scripts/live-queue-rewrite-test.sh prompt./examples/09_queue_hook_dogfood/scripts/live-queue-rewrite-test.sh summaryRequires OpenClaw fork
opencoat/hooks-v0.1(not npm registry). Seedocs/guides/openclaw-fork-dev.md.