Skip to content

feat: add cloud workspace readiness checks - #120

Merged
delete-cloud merged 4 commits into
mainfrom
feat-adr-0019-provider-readiness
May 9, 2026
Merged

delete-cloud merged 4 commits into
mainfrom
feat-adr-0019-provider-readiness

Conversation

@delete-cloud

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

Copy link
Copy Markdown
Owner

Summary

  • add a provider-level readiness hook to the cloud workspace registry and expose a Docker readiness probe backed by docker info
  • extend /readyz to report cloud_workspace only when cloud workspaces are enabled, returning 503 for invalid or unhealthy provider state
  • add scoped ADR task context plus HTTP and provider regression tests covering ready, unhealthy, and misconfigured cloud workspace paths

Verification

  • uv run pytest tests/ui/test_http_server.py -k readyz -v
  • uv run pytest tests/coding_agent/environment/test_docker_workspace_provider.py -k readiness -v
  • uv run pytest tests/ui/test_execution_binding.py -k readiness -v
  • uv run pytest tests/ui/test_http_server.py -v
  • uv run pytest tests/coding_agent/environment/test_docker_workspace_provider.py -v
  • uv run pytest tests/ui/test_execution_binding.py -v
  • uv run basedpyright src/coding_agent/ui/http_server.py src/coding_agent/environment/workspace_provider.py src/coding_agent/environment/docker_workspace_provider.py tests/ui/test_http_server.py tests/coding_agent/environment/test_docker_workspace_provider.py tests/ui/test_execution_binding.py
  • manual ASGI /readyz QA for enabled healthy provider (200), enabled unhealthy provider (503), and enabled invalid config (503)

Summary by CodeRabbit

  • New Features

    • Enhanced HTTP readiness endpoint to include cloud workspace health checks when enabled.
    • Added provider readiness validation capability, including Docker provider readiness checks.
  • Tests

    • Added regression tests for readiness checks covering Docker provider and HTTP endpoint scenarios.
    • Added provider registry wiring verification tests.
  • Documentation

    • Added an ADR describing the new readiness behavior, scope, and test targets.

Review Change Stack

delete-cloud and others added 3 commits May 9, 2026 16:54
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

coderabbitai Bot commented May 9, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e1c303fb-66d0-4659-bc48-effefba0a804

📥 Commits

Reviewing files that changed from the base of the PR and between 1bf1ab2 and 5b80393.

📒 Files selected for processing (2)
  • coding-agent/src/coding_agent/ui/http_server.py
  • coding-agent/tests/ui/test_http_server.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • coding-agent/tests/ui/test_http_server.py
  • coding-agent/src/coding_agent/ui/http_server.py

📝 Walkthrough

Walkthrough

This PR implements cloud workspace provider readiness checking: it extends the WorkspaceProvider protocol with a check_readiness method, implements Docker provider readiness validation, exports cloud_workspace_ready_from_config, integrates the check into the HTTP /readyz endpoint (conditional on cloud_workspace.enabled), and adds tests covering Docker readiness, registry wiring, and /readyz behaviors.

Changes

Cloud Workspace Provider Readiness

Layer / File(s) Summary
Specification & Design
coding-agent/.opencode/prompts/tasks/adr-0019-pr7-provider-readiness.md
ADR-0019 documents design goal, scope, non-goals, target files, and test plan for adding cloud workspace provider readiness validation to /readyz.
Provider Protocol & Contract
coding-agent/src/coding_agent/environment/workspace_provider.py
WorkspaceProvider protocol gains check_readiness(config) -> bool; cloud_workspace_ready_from_config(config) resolves the configured provider and returns its readiness status.
Docker Provider Implementation
coding-agent/src/coding_agent/environment/docker_workspace_provider.py
DockerWorkspaceProvider implements check_readiness delegating to _docker_provider_ready; _docker_provider_ready runs docker info --format {{json .}} with a timeout and returns True only on successful exit, otherwise False.
Public API Export
coding-agent/src/coding_agent/environment/__init__.py
cloud_workspace_ready_from_config is imported into the environment package and added to __all__ for public export.
HTTP Server Integration
coding-agent/src/coding_agent/ui/http_server.py
/readyz endpoint loads cloud_workspace config and, when cloud_workspace.enabled is true, invokes cloud_workspace_ready_from_config (offloaded via thread); failure or exceptions set cloud_workspace check to error and downgrade overall readiness (HTTP 503).
Provider Readiness Tests
coding-agent/tests/coding_agent/environment/test_docker_workspace_provider.py
Three tests validate Docker provider readiness: successful docker info execution, non-zero exit code, and missing Docker binary (OSError).
Registry Wiring Test
coding-agent/tests/ui/test_execution_binding.py
FakeWorkspaceProvider test double extended with check_readiness, import_workspace_archive, and export_workspace_archive; new test verifies registry wiring passes config to readiness check.
HTTP Readiness Tests
coding-agent/tests/ui/test_http_server.py
Three tests validate /readyz behavior: returns cloud_workspace: ok on provider success, cloud_workspace: error and HTTP 503 on provider failure, and HTTP 503 on invalid enabled config.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A hop, a sniff, a docker ping so light,
I check the workspace in the pale moonlight.
If containers answer true, I dance and cheer,
If not, I stamp my foot — no traffic near.
Hop on, tests pass — the loop stays bright!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 'feat: add cloud workspace readiness checks' accurately summarizes the main change—adding readiness checking capability to cloud workspace providers and integrating it into the HTTP readiness endpoint.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-adr-0019-provider-readiness

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 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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@coding-agent/src/coding_agent/ui/http_server.py`:
- Around line 715-723: The cloud readiness check currently calls the synchronous
cloud_workspace_ready_from_config(...) (which calls _docker_provider_ready() and
uses subprocess.run()) directly inside the async /readyz handler; change this to
run the blocking check off the event loop by invoking it with an async executor
(e.g., asyncio.to_thread or loop.run_in_executor) and awaiting the result, e.g.,
await asyncio.to_thread(cloud_workspace_ready_from_config,
cloud_workspace_config); keep the same try/except behavior and assignment to
checks["cloud_workspace"] and ready, and ensure _load_cloud_workspace_config()
remains called synchronously before offloading the blocking readiness function.
🪄 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: 6a252726-2e8a-44bf-a009-cca22d339161

📥 Commits

Reviewing files that changed from the base of the PR and between cc9c95b and 1bf1ab2.

📒 Files selected for processing (8)
  • coding-agent/.opencode/prompts/tasks/adr-0019-pr7-provider-readiness.md
  • coding-agent/src/coding_agent/environment/__init__.py
  • coding-agent/src/coding_agent/environment/docker_workspace_provider.py
  • coding-agent/src/coding_agent/environment/workspace_provider.py
  • coding-agent/src/coding_agent/ui/http_server.py
  • coding-agent/tests/coding_agent/environment/test_docker_workspace_provider.py
  • coding-agent/tests/ui/test_execution_binding.py
  • coding-agent/tests/ui/test_http_server.py

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 204ddbd into main May 9, 2026
1 check passed
@delete-cloud
delete-cloud deleted the feat-adr-0019-provider-readiness branch May 9, 2026 12:11
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