Repository navigation
feat(server): serve the CAS harness API from the stage image - #21
Merged
yash-kark merged 1 commit intoOct 28, 2026
Merged
Conversation
Merged
yash-kark
force-pushed
the
feat/p1-sdk-11-app-server
branch
7 times, most recently
from
October 28, 2026 17:19
fbbd638 to
4165713
Compare
Base automatically changed from
feat/p1-sdk-10-per-turn-key
to
feat/p1-sdk-2-remove-events-sink
October 28, 2026 17:20
computeragent.server (extra `server`), run as `python -m computeragent.server` on 0.0.0.0:8080: Lambda MicroVM lifecycle hooks, health, sessions, messages, events (SSE with Last-Event-ID replay), end-input, cancel, approvals and the workspace file routes, following computeragent-enterprise's harness-server. - One ComputerAgent per session from the image's settings; envs.LYZR_API_KEY seeds the key and each message's credential replaces it; turns run one at a time per process. - Events in sse-events.ts shapes: ca_turn_started and ca_redaction_decision (observed inline on the telemetry pipeline), sdk_message in the TS SDK's JSON shape, ca_permission_request/decision, ca_usage_snapshot before the turn's result, one ca_session_ended per session. - File routes confined to the workspace; deletes remove a file or an empty directory only. - Plan: Q16-Q18 resolved with the plan's recommendations; the turn-end wording corrected to the reference harness's behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yash-kark
force-pushed
the
feat/p1-sdk-11-app-server
branch
from
October 28, 2026 17:20
4165713 to
f0b45a0
Compare
yash-kark
merged commit Oct 28, 2026
8d76e37
into
feat/p1-sdk-2-remove-events-sink
0 of 4 checks passed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack: 11 of 12 (base #20). Plan:
.claude/plans/p1-sdk-egress-routes.mdphase 11 (C3; D22, D23). Q16–Q18 are resolved with the plan's recommendations: the SDK ships the server, the event mapping follows D23, andmessagesare handled as in D22.What changes
computeragent.server(extraserver: starlette, uvicorn). It runs aspython -m computeragent.serveron0.0.0.0:8080(PORToverrides the port). Routes, bodies, status codes and error codes follow CAS'sharness-server:/v1/health;GET …/eventsas server-sent events, withLast-Event-ID/?lastEventIdreplay and a 20 s keepalive;POST …/permission/:callIdfor approvals;fs/{file,tree,edit,mkdir,move}routes.ComputerAgentper session, built from the image'sCOMPUTERAGENT_*settings with noapi_key=.envs.LYZR_API_KEYseeds the key and every otherenvskey is ignored; each message'scredentialreplaces the key before its turn.identityis not read;engineis checked against the registered engines.messagesbecome the first turns, andstreamingInput: falsecloses input after them.sessionStoreis passed through.server/events.py), in CAS'ssse-events.tsshapes:ca_session_startedonce per session.ca_turn_startedandca_redaction_decisioncome from the SDK's telemetry. A pipeline middleware observes them inline, so they always precede the turn's output.sdk_messagepayloads are converted to the TS Claude Agent SDK's JSON shapes; gitagent's outputs are best-effort mapped.ca_permission_decision(source: "policy"); approvals asca_permission_requestand the client's decision.ca_usage_snapshotis sent before the turn'sresult, because the CAS client stops reading a turn at itsresult. A blocked input gets aresultmarkedca_policy_blocked.ca_session_endedis sent once, when the session ends.ComputerAgent.workspaceandComputerAgent.telemetry_pipeline;computeragent.engines.registered_engines().Deviations from the plan text (reviewers, please check)
ca_session_ended. The reference harness ends a turn with itsresultand sendsca_session_endedonce per session, so the server follows the harness, and the plan's D23 wording is corrected.POST …/messagesreturns 200{ok: true}andPOST /v1/sessionsaddseventsUrl, as the harness does. The plan said 202 and{sessionId}.409 WORKDIR_DIRECTORY_NOT_EMPTY, even withrecursive=true(the harness deletes recursively).Tests
ruffclean;mypyat 18 (baseline);pytest -m "not integration": 648 passed;uv buildOK.tests/test_server_app.py,tests/test_server_events.py,tests/test_server_fs.py. The tests run the realComputerAgentand coordinator with a fake engine; only the agent document and the guardrails check are mocked. They cover:sse-events.tsfield sets;cas-e2e-dummy/run_cas_e2e.sh, MicroVM, run withIMAGE_APP=sdk): real CAS bootspython -m computeragent.serverthrough the fake AWS, and the real egress proxy sits in front of the fake gateway.🤖 Generated with Claude Code