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
The quick-suite-claws project's plan tool handler calls bedrock-runtime:InvokeModel to generate query plans via an LLM. Integration tests that exercise the plan→excavate pipeline fail because Substrate doesn't emulate this endpoint.
Affected tests (8 failures in CI):
test_v1_collaboration.py::TestTeamIdOnPlans (2 tests) — plan creation with team_id
test_v1_collaboration.py::TestSharePlan (4 tests) — plan sharing + excavation
InvokeModel at /model/{modelId}/invoke should accept a JSON body with prompt or messages and return a stubbed/canned response. The response doesn't need to be a real LLM completion — a deterministic fixture response is sufficient for integration testing.
Minimum viable implementation
A stub that:
Accepts POST to /model/{modelId}/invoke
Returns a valid InvokeModelResponse with a canned body (e.g. {"completion": "SELECT * FROM table"})
Supports the contentType/accept headers
This would unblock all claws integration tests and any other project using Bedrock for LLM inference in their test suites.
Workaround
Currently these tests are allowed to fail in CI. The test job (lint + CDK synth) passes; only the integration job fails.
The unsupported path error is resolved — InvokeModel now responds. However, the response body format doesn't match what Anthropic Claude models return via the Messages API.
Expected response body format (Anthropic Claude on Bedrock):
What claws expects:response["body"].read() → JSON with content[].type == "text" blocks (line 164-186 in tools/plan/handler.py).
The stub needs to return a response body that matches this Anthropic Messages API format. Currently getting "Failed to parse model response" because result.get("content", []) returns no text blocks.
Ignore my previous comment about the response format — that's wrong. Bedrock InvokeModel is model-agnostic; the request/response body is opaque bytes defined by each model provider. Substrate can't and shouldn't hardcode Anthropic's Messages API schema.
The right fix is on the claws side: collaboration tests should mock bedrock_runtime for LLM calls (same as the plan handler's own unit tests already do) rather than expecting Substrate to return a valid Anthropic response.
This issue can be closed — InvokeModel support in v0.58.1 is working as expected. The remaining test failures are a test design problem on the claws side.
Activity
scttfrdmn commentedon Apr 10, 2026
Update after testing v0.58.1
The
unsupported patherror is resolved — InvokeModel now responds. However, the response body format doesn't match what Anthropic Claude models return via the Messages API.Expected response body format (Anthropic Claude on Bedrock):
{ "content": [{"type": "text", "text": "...generated text..."}], "stop_reason": "end_turn", "usage": {"input_tokens": 100, "output_tokens": 50} }What claws expects:
response["body"].read()→ JSON withcontent[].type == "text"blocks (line 164-186 intools/plan/handler.py).The stub needs to return a response body that matches this Anthropic Messages API format. Currently getting
"Failed to parse model response"becauseresult.get("content", [])returns no text blocks.Could the stub return a canned response like:
{ "content": [{"type": "text", "text": "{\"query\": \"SELECT 1\", \"output_schema\": {}}"}], "stop_reason": "end_turn" }scttfrdmn commentedon Apr 10, 2026
Ignore my previous comment about the response format — that's wrong. Bedrock InvokeModel is model-agnostic; the request/response body is opaque bytes defined by each model provider. Substrate can't and shouldn't hardcode Anthropic's Messages API schema.
The right fix is on the claws side: collaboration tests should mock
bedrock_runtimefor LLM calls (same as the plan handler's own unit tests already do) rather than expecting Substrate to return a valid Anthropic response.This issue can be closed — InvokeModel support in v0.58.1 is working as expected. The remaining test failures are a test design problem on the claws side.