Skip to content

SessionFs structured error contract + workspace E2E tests#1102

Draft
SteveSandersonMS wants to merge 1 commit intomainfrom
stevesa/workspace-manager-on-sessionfs
Draft

SessionFs structured error contract + workspace E2E tests#1102
SteveSandersonMS wants to merge 1 commit intomainfrom
stevesa/workspace-manager-on-sessionfs

Conversation

@SteveSandersonMS
Copy link
Copy Markdown
Contributor

Summary

Updates the Node.js SDK to support the new sessionFs structured error contract from github/copilot-agent-runtime#6479.

Changes

  • *Regenerated
    pc.ts*
    from updated \�pi.schema.json\ — all sessionFs result types now include an optional \�rror\ object:
    \\ ypescript
    error?: { code: 'ENOENT' | 'UNKNOWN'; message?: string }
    \\
  • Updated test handler (\createTestSessionFsHandler) to catch native fs errors and return { error: { code, message } }\ instead of throwing — this matches the new RPC contract where error classification is part of the response rather than relying on exception serialization
  • Added 2 E2E tests proving workspace files (workspace.yaml, plan.md) are written through sessionFs

Why

\�scode-jsonrpc\ \ResponseError\ loses the Node.js .code\ string property during serialization. The runtime's \WorkspaceManager.loadWorkspace()\ checks \�rror.code === 'ENOENT'\ to handle missing workspaces — without this contract, workspace initialization silently fails over SDK sessions.

Depends on

  • github/copilot-agent-runtime#6479

…e tests

- Regenerate rpc.ts from updated api.schema.json with structured error type
  (error?: { code: 'ENOENT' | 'UNKNOWN', message?: string }) on all sessionFs results
- Update createTestSessionFsHandler to catch fs errors and return error objects
  instead of throwing (matches the new RPC contract)
- Add E2E tests for workspace metadata and plan.md written via sessionFs
- Add test snapshots for new workspace tests

Depends on: github/copilot-agent-runtime#6479

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant