Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Code Branches Pull requestsIssuesInsights
main
Home Code PRsIssues

test: cover integrity mid-hash, canvas route conflict, and Responses gaps

open
Stack 2/2
#300 opened by cursor[bot]cursor/missing-test-coverage-c587→main
Conversation6
cursor[bot]
Commits
6
Files changed7
opened this pull request
Author
· last week

Summary

Adds focused regression coverage for high-risk seams that were still untested on main, while deliberately avoiding duplication of open coverage PRs #298 and #299.

Risky behavior now covered

  1. Runtime integrity mid-hash mutation — a tree that mutates after exact hashing but before attestation must fail closed (Runtime changed while it was being verified.) and must not write a trust attestation.
  2. Canvas document save conflicts through the workspace JSON-RPC route — conflict results preserve external file content and must not broadcast cowork/workspace/fileChanged.
  3. OpenAI Responses history conversion — pending tool calls get synthetic No result provided outputs; cross-model conversion sanitizes/remaps pipe-delimited tool-call IDs, strips thought signatures, and drops sibling-model fc_ item IDs.
  4. Windows sandbox setup newest-wins fallback — when marker created_at is missing/invalid, marker mtime decides which DPAPI credential state propagates.

Test files added/updated

  • src/coworkRuntime/integrity.ts — tiny test-only afterVerifyExactTree hook (no production behavior change)
  • test/coworkRuntime.test.ts
  • test/jsonrpc.workspace-route.test.ts
  • test/runtime.openai-responses-shared.test.ts (new)
  • test/platform/windowsSetupSync.test.ts

Why these tests materially reduce regression risk

  • Integrity attestation/caching protects a ~GB signed runtime tree; a miss here can trust a mutated runtime.
  • Canvas conflict broadcast suppression prevents clients from treating a failed save as authoritative.
  • Responses history normalization is on the critical path for tool-call continuity and API payload validity across model switches.
  • Sandbox mtime fallback prevents stale Windows credential state from clobbering newer setup and triggering setup churn.

Validation

  • Targeted: 34 pass across touched suites
  • Touched files Biome-clean (biome check)
  • bun run typecheck / bun run lint / bun run docs:check clean
  • Full bun run test: all 673 files passed

Notes

  • Open PRs #298/#299 were left alone; this run covers residual gaps outside those diffs.
  • No flaky/environment-dependent tests added.
Open in Web View Automation 

Cursor Agent and others added 6 commits · 19 hours ago

View commits
  • test: cover canvas save conflict through workspace JSON-RPC route14879f8
  • test: cover runtime integrity mid-hash mutation fail-closed918aa21
  • test: cover Responses history normalization and sandbox mtime fallbacke187364
  • chore: refresh mobile lockfile for canary bun install24bb2d3
  • test: stabilize research-readiness desktop bridge for persist5576938
  • Merge remote-tracking branch 'origin/main' into pr-autosyncfd0ff92
This branch has no conflicts with the base branch
Merging can be performed automatically when you’re allowed to merge and required checks pass.
0 approving reviews
None yet
Checks
No checks recorded
Fast-forward
Ready to merge without a merge commit
main ← cursor/missing-test-coverage-c587

Only the target repository owner can merge this pull request.

Sign in to comment.

Stack

2/2
1

Merge readiness

Ahead6
Behind0
Fast-forwardReady

This pull request can be merged without creating a merge commit.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.

Update README.md

#125 mobile-fixes ← main

Updated 2 months ago

merged
2

test: cover integrity mid-hash, canvas route conflict, and Responses gaps

#300 main ← cursor/missing-test-coverage-c587

Updated 19 hours ago

open