You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add workspace_source.kind = git request schema with remote URL, base ref, base SHA, and optional runtime profile
fail closed with HTTP 501 until Git-backed workspace provisioning is implemented
ensure Git source requests do not fall through to Docker provider provisioning
Validation
uv run pytest tests/ui/test_http_server.py -k "git_workspace_source_until_supported" -q
uv run pytest tests/ui/test_http_server.py -k "git_workspace_source_until_supported or provisions_docker_cloud_workspace or rejects_workspace_provisioning_when_disabled or rejects_conflicting_workspace_binding_inputs or RemoteResultPublicationContract" -q
uv run pytest tests/ui/test_http_server.py tests/ui/test_http_server_workspace_transfer.py -k "workspace_source or git_workspace or docker_cloud_workspace or workspace_transfer or RemoteResultPublicationContract" -q
uv run basedpyright --level error src/coding_agent/ui/schemas.py src/coding_agent/ui/http_server.py tests/ui/test_http_server.py
uv run ruff format --check src/coding_agent/ui/schemas.py src/coding_agent/ui/http_server.py tests/ui/test_http_server.py
This PR adds a GitWorkspaceSourceRequest schema to the API contract, implements early rejection of Git workspace sources during provisioning with HTTP 501 status, improves error handling to preserve HTTP exception details, and adds test coverage validating the rejection behavior.
Changes
Git workspace source request schema and validation
Introduces GitWorkspaceSourceRequest Pydantic model with kind="git" literal, required Git-specific fields (remote_url, base_ref, base_sha), and optional runtime_profile. Updates WorkspaceSourceRequest union type to accept both Docker and Git sources.
Git workspace rejection and error handling coding-agent/src/coding_agent/ui/http_server.py
Adds explicit check in _provisioned_execution_binding_from_request to detect Git workspace sources and raise HTTP 501 "git workspace source is not implemented yet". Improves create_session error handling to re-raise HTTPException instances, preserving their original status codes and details instead of remapping them.
Git workspace rejection test coding-agent/tests/ui/test_http_server.py
Adds test test_create_session_rejects_git_workspace_source_until_supported that verifies session creation with Git workspace source fails with HTTP 501 and the expected error message when cloud workspace provisioning is configured.
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
A rabbit hops through Git-shaped dreams,
But workspace sources aren't what they seem,
With 501, "not yet!" it declares,
While schemas and tests show utmost care. 🐰
The title 'feat: add git workspace source contract' clearly and concisely describes the main change—adding a Git workspace source schema and related contract implementation.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
✏️ 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/git-workspace-source-contract
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workspace_source.kind = gitrequest schema with remote URL, base ref, base SHA, and optional runtime profileValidation
uv run pytest tests/ui/test_http_server.py -k "git_workspace_source_until_supported" -quv run pytest tests/ui/test_http_server.py -k "git_workspace_source_until_supported or provisions_docker_cloud_workspace or rejects_workspace_provisioning_when_disabled or rejects_conflicting_workspace_binding_inputs or RemoteResultPublicationContract" -quv run pytest tests/ui/test_http_server.py tests/ui/test_http_server_workspace_transfer.py -k "workspace_source or git_workspace or docker_cloud_workspace or workspace_transfer or RemoteResultPublicationContract" -quv run basedpyright --level error src/coding_agent/ui/schemas.py src/coding_agent/ui/http_server.py tests/ui/test_http_server.pyuv run ruff format --check src/coding_agent/ui/schemas.py src/coding_agent/ui/http_server.py tests/ui/test_http_server.pygit diff --check