feat(client): serve conversation workspace static files#244
Open
VascoSch92 wants to merge 1 commit into
Open
Conversation
Adds client coverage for the agent-server's static workspace routes:
- GET /api/conversations/{id}/workspace -> getWorkspaceRoot()
- GET /api/conversations/{id}/workspace/{path} -> getWorkspaceFile()
Both return the raw bytes as a Blob (call .text() for HTML/text) so
binary artifacts survive intact, mirroring FileClient.downloadTrajectory.
Includes a mocked unit test (both routes, blob round-trip) and an
integration test that round-trips a written root index.html and a nested
file, and asserts 404 for a missing file.
Contributor
Endpoint audit❌ 8 off-contract call(s) — not on the agent-server · classifiers: cloud
❌ Not on agent-server (gated, 8)⛔ (no known backend) — served by no backend we can see (7)
|
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.
Summary
Split from #231 (one feature per PR). Adds client coverage for the agent-server's static workspace-serving routes, which the audit reported as missing.
GET /api/conversations/{id}/workspaceConversationClient.getWorkspaceRoot()GET /api/conversations/{id}/workspace/{path}ConversationClient.getWorkspaceFile()Details
Blob(call.text()for HTML/text) so binary artifacts survive intact, matchingFileClient.downloadTrajectory.getWorkspaceRootserves the workspace rootindex.html;getWorkspaceFileserves a workspace-relative file (nested paths supported). The agent-server only serves local workspaces — non-local workspaces, a missing directory/file, or the absence ofindex.htmlyield 404; path traversal is rejected with 400.Testing
src/__tests__/api-clients.test.ts, mockedfetch): both routes are GET, return aBlob, and round-trip text content; asserts the exact URLs (including the nested path).deterministic-api.integration.test.ts): writes a rootindex.htmland a nested file into the mounted workspace, serves both back verbatim through the static routes, and asserts404for a missing file.npm run build,lint(0 errors), andformat:checkpass; full unit suite green.