Repository navigation
refactor: move runtime metadata into runs service - #497
Conversation
📝 WalkthroughWalkthroughThis PR extracts runtime metadata construction and execution-placement derivation into a centralized ChangesRuntime Metadata Service Centralization
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Local fallback review note: CodeRabbit is still pending and has not produced actionable review output yet. I performed a manual P1/P2 review of the diff for correctness, data compatibility, scope, and test coverage. No actionable P1/P2 findings found. Verification already run locally:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
coding-agent/tests/coding_agent/test_runtime_metadata_service.py (1)
77-96: ⚡ Quick winConsider adding test coverage for external worker with
workspace_ref=None.The implementation correctly handles
workspace_ref=Noneby omitting it from the metadata dict, but there's no test case verifying this behavior. Adding a test would improve coverage.🧪 Suggested test case
def test_runtime_metadata_service_omits_none_workspace_ref() -> None: service = RuntimeRunMetadataService() binding = ExternalWorkerBinding( executor_kind="local_cli", worker_pool="pool-a", workspace_ref=None, ) metadata = service.metadata_for_session(FakeSession(execution_binding=binding)) assert "workspace_ref" not in metadata assert metadata["executor_kind"] == "local_cli" assert metadata["worker_pool"] == "pool-a"🤖 Prompt for 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. In `@coding-agent/tests/coding_agent/test_runtime_metadata_service.py` around lines 77 - 96, Add a new unit test that verifies RuntimeRunMetadataService.metadata_for_session omits the workspace_ref key when an ExternalWorkerBinding is created with workspace_ref=None: instantiate RuntimeRunMetadataService, create ExternalWorkerBinding(executor_kind="local_cli", worker_pool="pool-a", workspace_ref=None), call metadata_for_session with a FakeSession(execution_binding=binding), then assert "workspace_ref" not in metadata and that metadata["executor_kind"] == "local_cli" and metadata["worker_pool"] == "pool-a"; you can mirror the existing test_runtime_metadata_service_reports_external_worker_metadata structure and also assert runtime_execution_placement(binding) if desired.
🤖 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.
Nitpick comments:
In `@coding-agent/tests/coding_agent/test_runtime_metadata_service.py`:
- Around line 77-96: Add a new unit test that verifies
RuntimeRunMetadataService.metadata_for_session omits the workspace_ref key when
an ExternalWorkerBinding is created with workspace_ref=None: instantiate
RuntimeRunMetadataService, create
ExternalWorkerBinding(executor_kind="local_cli", worker_pool="pool-a",
workspace_ref=None), call metadata_for_session with a
FakeSession(execution_binding=binding), then assert "workspace_ref" not in
metadata and that metadata["executor_kind"] == "local_cli" and
metadata["worker_pool"] == "pool-a"; you can mirror the existing
test_runtime_metadata_service_reports_external_worker_metadata structure and
also assert runtime_execution_placement(binding) if desired.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4d40475d-9d4e-423c-9e6a-a85d9ed09845
📒 Files selected for processing (7)
coding-agent/docs/adr/0058-local-daemon-control-plane-executor-architecture.mdcoding-agent/src/coding_agent/runs/__init__.pycoding-agent/src/coding_agent/runs/lifecycle.pycoding-agent/src/coding_agent/runs/metadata.pycoding-agent/src/coding_agent/runs/observation.pycoding-agent/src/coding_agent/server/session_manager.pycoding-agent/tests/coding_agent/test_runtime_metadata_service.py
Summary
Tests
Review
Summary by CodeRabbit
Tests
Refactor
Documentation