Skip to content

Expand Agent Host end-to-end coverage - #328341

Draft
roblourens wants to merge 1 commit into
mainfrom
roblou/agents/agent-host-e2e-test-coverage
Draft

Expand Agent Host end-to-end coverage#328341
roblourens wants to merge 1 commit into
mainfrom
roblou/agents/agent-host-e2e-test-coverage

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

  • add 44 net-new host-only Agent Host E2E declarations over the public AHP WebSocket boundary
  • cover resource mutation/error semantics, changeset operation invocation, handshake/reconnect contracts, and session catalog behavior
  • preserve JSON-RPC error codes and data in the E2E protocol client for typed assertions
  • refresh implementation and protocol-surface coverage artifacts

Coverage

Compared with the fresh baseline captured before these rounds:

  • lines/statements: 67,012/95,415 (70.23%) -> 67,536/95,415 (70.78%), +524 covered
  • functions: 2,203/3,616 (60.92%) -> 2,232/3,618 (61.69%), +29 covered
  • branches: 5,857/9,285 (63.08%) -> 6,026/9,510 (63.36%), +169 covered; native V8 branch denominators vary slightly
  • AHP commands: 28/29 -> 29/29 (100%)
  • AHP actions: 64/85 -> 65/85, adding changeset/operationStatusChanged

Validation

  • npm run typecheck-client
  • node build/next/index.ts transpile
  • focused conformance replay for all new declarations
  • representative host-only test under AGENT_HOST_REPLAY_RECORD=1 with no fixture created
  • npm run test-agent-host-e2e-coverage (224 passing, 56 expected pending)
  • npm run valid-layers-check
  • npm run precommit
  • git diff --check

(Written by Copilot)

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>
Copilot AI review requested due to automatic review settings July 31, 2026 03:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants