fix(reborn): harden activity identity invariants - #5356
hanakannzashi wants to merge 3 commits into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
📝 WalkthroughWalkthroughThe PR adds single-call validation for resume dispatch, rejects duplicate activity ids in denied-resume batches, and threads ChangesActivity identity and blocked-run metadata
Sequence Diagram(s)sequenceDiagram
participant AgentLoopExecutor
participant CapabilityStage
participant Host
AgentLoopExecutor->>CapabilityStage: process_resume_capability_calls(calls)
CapabilityStage->>CapabilityStage: resume_capability_input validates one call
CapabilityStage->>CapabilityStage: short_circuit_denied_resume checks unique activity_id values
CapabilityStage->>Host: process capability input when validation passes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/ironclaw_agent_loop/src/executor/tests.rs`:
- Around line 6779-6809: The current test only covers resume_capability_input
directly, but the guard is enforced through DefaultExecutorPipeline::execute on
the real resume path. Add a caller-level regression that drives the actual
resume dispatch entrypoint with multiple CapabilityCallCandidate values, then
assert the PlannerContract error and verify MockHost receives no invocation.
Keep the existing helper-level check if needed, but make sure the new test
exercises DefaultExecutorPipeline::execute or the surrounding resume flow so the
side-effect gate is covered end-to-end.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7e46a06a-54d7-4774-b41f-ec7069f0bd09
📒 Files selected for processing (12)
crates/ironclaw_agent_loop/src/executor.rscrates/ironclaw_agent_loop/src/executor/canonical.rscrates/ironclaw_agent_loop/src/executor/capabilities.rscrates/ironclaw_agent_loop/src/executor/tests.rscrates/ironclaw_reborn_composition/src/factory/auth_tests.rscrates/ironclaw_reborn_composition/src/runtime.rscrates/ironclaw_reborn_composition/src/runtime/tests/auth_interaction.rscrates/ironclaw_turns/src/memory/mod.rscrates/ironclaw_turns/src/runner.rscrates/ironclaw_turns/tests/per_inbound_type_concurrency_cap.rscrates/ironclaw_turns/tests/per_user_concurrency_cap.rscrates/ironclaw_turns/tests/turn_coordinator_contract.rs
|
🚅 Deployed to the ironclaw-pr-5356 environment in ironclaw-ci-preview
|
…dentity-invariants
Closes #5219.
Summary
CapabilityActivityIds, before dispatching capabilities or emitting terminal activity milestones.blocked_activity_idthrough directBlockRunRequestso direct block transitions can preserve parked activity identity in state and lifecycle events.Tests
cargo check -p ironclaw_turns --testscargo check -p ironclaw_agent_loop --testscargo check -p ironclaw_reborn_composition --features test-support,webui-v2-beta,slack-v2-host-beta,libsql --testscargo test -p ironclaw_agent_loop capability_stage_denied_auth_resume_rejects_duplicate_activity_id_before_side_effects -- --nocapturecargo test -p ironclaw_agent_loop resume_capability_input_rejects_batched_resume_calls -- --nocapturecargo test -p ironclaw_turns lifecycle_publishing_store_publishes_blocked_event_activity_id_from_block_run -- --nocapturecargo clippy -p ironclaw_agent_loop --all-targets -- -D warningscargo clippy -p ironclaw_turns --all-targets -- -D warningscargo clippy -p ironclaw_reborn_composition --features test-support,webui-v2-beta,slack-v2-host-beta,libsql --all-targets -- -D warnings