Expand Agent Host end-to-end coverage - #328341
Draft
roblourens wants to merge 1 commit into
Draft
Conversation
Add host-only AHP coverage for resource operations, changeset invocation, protocol handshakes, and session catalogs. Preserve typed JSON-RPC errors in the test client for precise assertions.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Expands Agent Host end-to-end protocol coverage to assert additional handshake, session catalog, filesystem, and changeset behaviors across the public AHP WebSocket boundary, while preserving JSON-RPC error codes/data for typed assertions.
Changes:
- Preserve JSON-RPC error code/data in the E2E protocol client by rejecting with a typed
ProtocolError. - Add new protocol contract E2E tests (pre-initialize behavior, initialize negotiation, listSessions semantics, fetchTurns validation).
- Add extensive client filesystem and changeset E2E coverage, and refresh coverage/protocol-surface artifacts.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/serverIntegrationTestHelpers.ts | Switches JSON-RPC error handling to reject with ProtocolError to keep code/data for assertions. |
| src/vs/platform/agentHost/test/node/e2e/suites/protocolContractsSuite.ts | Adds protocol contract tests for handshake/initialize behavior, sessions catalog semantics, and fetchTurns validation. |
| src/vs/platform/agentHost/test/node/e2e/suites/clientFilesystemSuite.ts | Adds host filesystem mutation/error semantic tests (write modes, etag/exists semantics, copy/move/delete). |
| src/vs/platform/agentHost/test/node/e2e/suites/changesetSuite.ts | Adds changeset operation invocation/status contract tests and helper logic to await operation readiness. |
| src/vs/platform/agentHost/test/node/e2e/coverage/summary.json | Updates coverage summary numbers to reflect new declarations and execution. |
| src/vs/platform/agentHost/test/node/e2e/coverage/protocol-surface.json | Updates protocol-surface coverage to mark newly covered command/action symbols. |
Review details
- Files reviewed: 4/6 changed files
- Comments generated: 2
- Review effort level: Lite
Comment on lines
+171
to
+175
| const changed = getActionEnvelope(n).action as IOperationStatusChangedAction; | ||
| const operation = operations.get(changed.operationId); | ||
| if (operation) { | ||
| operations.set(changed.operationId, { ...operation, status: changed.status }); | ||
| } |
Comment on lines
+76
to
+83
| conformanceTest(context, 'requests other than ping are rejected before initialize', async function () { | ||
| const client = await context.connectClient(); | ||
| try { | ||
| await assert.rejects(client.call('listSessions', { channel: ROOT_STATE_URI })); | ||
| } finally { | ||
| client.close(); | ||
| } | ||
| }); |
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
Coverage
Compared with the fresh baseline captured before these rounds:
Validation
npm run typecheck-clientnode build/next/index.ts transpileAGENT_HOST_REPLAY_RECORD=1with no fixture creatednpm run test-agent-host-e2e-coverage(224 passing, 56 expected pending)npm run valid-layers-checknpm run precommitgit diff --check(Written by Copilot)