Skip to content

feat(sdk): add optional computer field to hostConfig v2 (Project Computers PR1)#2548

Merged
chelojimenez merged 2 commits into
mainfrom
claude/blissful-carson-wbqgh5
Jun 10, 2026
Merged

feat(sdk): add optional computer field to hostConfig v2 (Project Computers PR1)#2548
chelojimenez merged 2 commits into
mainfrom
claude/blissful-carson-wbqgh5

Conversation

@chelojimenez

@chelojimenez chelojimenez commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

First implementation slice of Project Computers (plan: MCPJam/mcpjam-backend#485, docs/project-computers.md). SDK only — no backend, server, or UI changes; those land as PR2–PR4 per the phased rollout.

What

Adds one optional field to the hostConfig v2 surface:

computer?: null | { kind: "personal"; toolset: "bash"; workdir?: string }

following the progressiveToolDiscovery pattern exactly: absent (or null) writes no key, so every existing host config hashes byte-identically to before this change. The regenerated parity fixture proves it — all 14 pre-existing golden vectors kept their pinned canonical JSON and sha256; the only fixture changes are the new computer row and the drift-guard __inputHash.

Changes

  • types.tsHostConfigComputer; computer?: HostConfigComputer | null on HostConfigInputV2, computer?: HostConfigComputer on CanonicalHostConfigV2.
  • canonicalize.tscanonicalizeComputer(): collapses null → undefined (an editor "clear" hashes identically to never-set), validates the kind/toolset literals, rejects unknown keys (typo defense + keeps stray keys out of the hashed canonical JSON), trims workdir with empty-after-trim collapsing to absent.
  • host.ts / public-types.ts — public HostComputer type, computer on HostJson/HostInit/the Host builder, plus setComputer() sugar (defaults to the only MVP shape; null detaches). Round-trips through toJSON().
  • sdk-evals-normalizer.tsnormalizeSdkEvalHostConfigForWire now strips computer on both accepted input shapes (canonical input and Host.toJSON() snapshot). A personal computer is mutable per-user state, so an eval that shells into it isn't reproducible — evals never carry the field. The backend's belt-and-suspenders run-start rejection lands in PR2.
  • BarrelsHostConfigComputer exported from host-config/internal, HostComputer from the public entries.

Tests

  • Canonicalization: absent/null/personal/workdir variants, hash distinctions, workdir trim, and all validation rejections.
  • Eval wire: computer stripped from both input shapes; wire hash provably independent of the computer the host carried.
  • Host builder: setComputer() attach/detach and full toJSON() round-trip with workdir normalization.
  • Golden parity vector computer-personal-with-untrimmed-workdir added via the fixture generator; EXPECTED_INPUT_HASH bumped.

SDK suite: 84 files, 1377 passed. Workspace typechecks (npm run typecheck, typecheck:client) clean.

https://claude.ai/code/session_01Jf7p3Q1YQN8sKzi3hTzcuh


Generated by Claude Code


Note

Low Risk
SDK-only schema extension with backward-compatible hashing; eval wire explicitly drops the new field so ingestion behavior for existing evals stays unchanged until backend PR2.

Overview
Adds an optional computer dimension to HostConfig v2 so a host can declare a personal cloud workstation (chat bash tool + web terminal): { kind: "personal"; toolset: "bash"; workdir?: string }, with null/absent normalized so existing configs keep the same configHash.

Canonicalization introduces canonicalizeComputer() (literal validation, unknown-key rejection, workdir trim) and wires it into canonicalizeHostConfigV2. The public Host surface gains computer, setComputer(), and HostComputer exports on HostJson / HostInit.

Eval wire: normalizeSdkEvalHostConfigForWire now strips computer (with runtime server ids) so eval transport hashes ignore per-user machine state.

Coverage includes unit tests, a new parity golden row, and a minor @mcpjam/sdk changeset.

Reviewed by Cursor Bugbot for commit 29d4f99. Bugbot is set up for automated code reviews on this repo. Configure here.

…mputers PR1)

Adds `computer?: null | { kind: "personal"; toolset: "bash"; workdir?: string }`
to the hostConfig v2 surface, following the progressiveToolDiscovery pattern:
absent (or null) omits the key entirely, so existing rows hash byte-identically
to pre-feature rows — confirmed by the untouched golden vectors in the
regenerated parity fixture.

- types: HostConfigComputer + input/canonical fields; public HostComputer,
  HostJson.computer, HostInit.computer; exported from internal + public barrels
- canonicalize: null → undefined collapse, literal validation, unknown-key
  rejection (hash hygiene), workdir trim with empty-after-trim → absent
- Host builder: property, constructor init, setComputer() sugar, round-trip
- eval wire: normalizeSdkEvalHostConfigForWire strips computer on both input
  shapes — evals never carry a personal computer (mutable per-user state;
  backend run-start rejection lands in PR2)
- tests: canonicalization absent/null/personal/workdir + validation, wire
  stripping + hash independence, Host round-trips, new golden parity vector

Plan: mcpjam-backend docs/project-computers.md (MCPJam/mcpjam-backend#485).

https://claude.ai/code/session_01Jf7p3Q1YQN8sKzi3hTzcuh
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jun 10, 2026
@chelojimenez

chelojimenez commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 000d493c-90ae-4063-aaf5-9c6e7924aa33

📥 Commits

Reviewing files that changed from the base of the PR and between f71298e and 29d4f99.

📒 Files selected for processing (7)
  • .changeset/project-computers-host-config.md
  • sdk/scripts/gen-host-config-parity-fixture.mjs
  • sdk/src/host-config/canonicalize.ts
  • sdk/src/host-config/types.ts
  • sdk/tests/fixtures/host-config-parity-fixtures.json
  • sdk/tests/host-config-canonicalize.test.ts
  • sdk/tests/host-config-parity.test.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/project-computers-host-config.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • sdk/scripts/gen-host-config-parity-fixture.mjs
  • sdk/tests/host-config-parity.test.ts
  • sdk/tests/fixtures/host-config-parity-fixtures.json
  • sdk/src/host-config/types.ts
  • sdk/src/host-config/canonicalize.ts
  • sdk/tests/host-config-canonicalize.test.ts

Walkthrough

This pull request introduces a personal cloud workstation configuration model to HostConfig v2. The change adds a HostConfigComputer type constraining to personal bash toolsets with optional working directories, implements deterministic canonicalization that trims and normalizes paths, integrates the field into the Host class with a fluent setComputer() setter, exposes the type through public module boundaries, ensures the field is stripped from wire payloads for evaluation safety, and validates the implementation through unit tests, round-trip tests, and fixture verification.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Resolves the hostConfig v2 conflict with #2511 (builtInToolIds). Both
'computer' (this branch) and 'builtInToolIds' (main) are independent
optional dimensions, so the resolution is a union: keep both fields in
types.ts / canonicalize.ts, both golden rows in the fixture generator,
and both describe blocks in the canonicalize test (the latter two
auto-merged). Regenerated the parity fixture (17 vectors) and bumped
EXPECTED_INPUT_HASH to the combined value. Added the .changeset entry
for 'computer' that PR1 was missing (mirrors #2511's).

https://claude.ai/code/session_01Jf7p3Q1YQN8sKzi3hTzcuh
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Internal preview

Preview URL: https://mcp-inspector-pr-2548.up.railway.app
Deployed commit: c040604
PR head commit: 29d4f99
Backend target: staging fallback.
Health: ❌ Convex unreachable — see job logs (staging may need convex deploy)
Access is employee-only in non-production environments.

@chelojimenez chelojimenez merged commit 6c69fc4 into main Jun 10, 2026
12 checks passed
@chelojimenez chelojimenez deleted the claude/blissful-carson-wbqgh5 branch June 10, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants