Skip to content

docs(adr): add ADR-0018 plan - #105

Merged
delete-cloud merged 3 commits into
mainfrom
docs/adr-0018-subagent-orchestration
May 4, 2026
Merged

delete-cloud merged 3 commits into
mainfrom
docs/adr-0018-subagent-orchestration

Conversation

@delete-cloud

@delete-cloud delete-cloud commented May 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add ADR-0018 for owner-local, cloud-aware subagent orchestration.
  • Add the PR1 task packet that gates the implementation with executable acceptance criteria.
  • Keep the code path owner-local: cloud environment inheritance, authoritative trace metadata, and stale-owner summary publish fail-fast behavior are covered by tests.

Verification

  • uv run pytest tests/coding_agent/tools/test_subagent.py tests/coding_agent/subagents/test_coordinator.py -v
  • uv run pytest tests/coding_agent/test_bootstrap.py tests/ui/test_session_manager_public_api.py tests/ui/test_session_manager_owner_checks.py -k "subagent or cloud" -v
  • uv run python -m compileall -q src tests/coding_agent tests/ui
  • Manual tmux QA of build_subagent_tool with cloud environment inheritance and stale-owner failure path

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Subagent summary publishing now properly propagates session ownership conflict errors instead of silently ignoring them.
  • Documentation

    • Added Architecture Decision Record 0018 defining owner-local, cloud-aware subagent orchestration behavior and constraints.
  • Tests

    • Added regression tests verifying cloud environment inheritance, metadata preservation, and ownership validation in subagent execution.

delete-cloud and others added 2 commits May 5, 2026 00:19
Keep generic publisher failures best-effort, but let owner-conflict errors bubble so stale owners cannot hide subagent publication races.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Record the owner-local cloud-aware subagent decision and the PR1 task packet that gates the implementation against executable acceptance criteria.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@coderabbitai

coderabbitai Bot commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@delete-cloud has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 46 minutes and 39 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d309b7c-f59b-4959-aee7-152c65ab2c90

📥 Commits

Reviewing files that changed from the base of the PR and between 4fe6e5f and 4bb15eb.

📒 Files selected for processing (1)
  • coding-agent/docs/adr/0018-owner-local-cloud-aware-subagent-orchestration.md
📝 Walkthrough

Walkthrough

This PR codifies ADR-0018 for owner-local, cloud-aware subagent orchestration parity. It adds architecture documentation, a task specification for regression testing, a small behavioral change to explicitly propagate ownership errors, and comprehensive test coverage validating cloud environment forwarding, trace metadata preservation, and ownership conflict error propagation.

Changes

Owner-Local Subagent Orchestration & Error Handling

Layer / File(s) Summary
Architecture & Decision Record
docs/adr/0018-owner-local-cloud-aware-subagent-orchestration.md, .opencode/prompts/tasks/adr-0018-pr1-owner-local-subagent-parity.md
ADR-0018 establishes invariants for owner-local child execution, environment/metadata inheritance rules, trace metadata stripping/injection, summary publication routing, and serialization via ChildWorkerCoordinator. Task spec defines regression boundaries and target test commands.
Error Propagation
src/coding_agent/tools/subagent.py
_publish_subagent_summary explicitly catches SessionOwnershipConflictError and re-raises it instead of handling under generic exception path.
Test Infrastructure
tests/coding_agent/tools/test_subagent.py
Introduces CloudTraceClient stub implementing cloud workspace operations (file/search/patch/command methods). Enables cloud-focused subagent test cases.
Verification Tests
tests/coding_agent/tools/test_subagent.py, tests/ui/test_session_manager_owner_checks.py
Three new async tests verify: (1) CloudEnvironment is forwarded unchanged to child builder, (2) trace metadata preserves authoritative cloud.workspace_id while stripping sensitive/extra fields and appending subagent.* keys, (3) SessionOwnershipConflictError during summary publish propagates rather than being swallowed. Session manager test validates stale owner rejection via runtime message bus.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~18 minutes

Possibly related PRs

  • PR #99: Modifies the same _publish_subagent_summary flow and subagent error handling pathways.
  • PR #97: Implements the child AgentRunContext derivation (run_id, environment, metadata merging) that these tests validate is correctly forwarded from parent.
  • PR #79: Introduces SessionOwnershipConflictError and owner-fencing checks that this PR's tests exercise during stale ownership scenarios.

Poem

🐰 A subagent born beneath the parent's watchful eye,
Inherits all the tools and traces, secrets passing by,
When ownership grows stale, the error takes its stand—
No silent swallowing of faults in this orchestrated land!
Cloud-aware and owner-bound, each child knows its place. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(adr): add ADR-0018 plan' is specific and clearly describes the main change—adding ADR-0018 documentation and its implementation plan—which aligns with the actual changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/adr-0018-subagent-orchestration

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
Review rate limit: 0/1 reviews remaining, refill in 46 minutes and 39 seconds.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@coding-agent/docs/adr/0018-owner-local-cloud-aware-subagent-orchestration.md`:
- Line 162: The acceptance-check pytest command omits the test file containing
test_subagent_summary_publish_rejects_stale_owner; update the checklist command
(the line with the pytest invocation) to include
tests/ui/test_session_manager_owner_checks.py so that
test_subagent_summary_publish_rejects_stale_owner (and any other owner-check
tests) are executed when someone runs the acceptance command.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 83e9239a-4bfd-4992-8c21-2d62c833d2c1

📥 Commits

Reviewing files that changed from the base of the PR and between 350c977 and 4fe6e5f.

📒 Files selected for processing (5)
  • coding-agent/.opencode/prompts/tasks/adr-0018-pr1-owner-local-subagent-parity.md
  • coding-agent/docs/adr/0018-owner-local-cloud-aware-subagent-orchestration.md
  • coding-agent/src/coding_agent/tools/subagent.py
  • coding-agent/tests/coding_agent/tools/test_subagent.py
  • coding-agent/tests/ui/test_session_manager_owner_checks.py

Keep the ADR-0018 acceptance command aligned with the checklist by including the owner-check test file that exercises stale-owner summary publish rejection.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@delete-cloud
delete-cloud merged commit 8d0b3cb into main May 4, 2026
1 check passed
@delete-cloud
delete-cloud deleted the docs/adr-0018-subagent-orchestration branch May 4, 2026 17:05
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.

1 participant