Home

mweinbach / agent-coworker

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

test: cover runtime archive, HTTP RPC timeout, and backup containment

open
Stack 2/2
#307 opened by cursor[bot]cursor/missing-test-coverage-3200→main
Conversation3
cursor[bot]
Commits
3
Files changed10
opened this pull request
Author
· 2 days ago

Summary

Adds focused regression coverage for residual high-risk seams on main that are still untested and not claimed by open coverage PRs #298–#306 (main tip still at fa5c0f68). Also refreshes canary mobile lockfile + research-readiness desktop bridge stabilizers, and unflakes the calendar-aged composer draft prune assertion.

Risky behavior now covered

  • Managed runtime archive install fail-closed — invalid expected SHA-256, checksum mismatch (no install), and already-installed overwrite without force.
  • HTTP JSON-RPC response timeout — unanswered /rpc requests return 503 with Timed out waiting for JSON-RPC response. and clear pending waiters (tiny injectable responseTimeoutMs test seam).
  • Session backup containment — create refuses backups whose directory would sit inside the working directory; restore refuses poisoned metadata that places the backup under WD; create refuses mismatched session-id reuse.
  • MCP invalid client / tool schemas — optional servers collect invalid runtime shape / invalid tool definitions; required invalid shape tears down peer clients and throws.
  • Provider API-key connect exception — unexpected connect throws emit provider_error (Setting provider API key failed: …) and always clear connecting.

Test files added/updated

  • test/coworkRuntime.installArchive.test.ts (added)
  • test/h3.http-jsonrpc-timeout.test.ts (added)
  • test/session-backup.containment.test.ts (added)
  • test/mcp.invalid-client.test.ts (added)
  • test/session/agentSession.provider-api-key-exception.test.ts (added)
  • src/server/transport/httpJsonRpcConnection.ts / src/server/transport/h3/server.ts (responseTimeoutMs option only)
  • apps/desktop/test/research-readiness.test.tsx + apps/mobile/bun.lock (CI stabilizers)
  • apps/desktop/test/composer-draft-thread-switch.test.ts (Date.now()-relative prune fixtures)

Why these tests materially reduce regression risk

These paths are trust boundaries and stuck-state hazards: corrupt runtime install, hung mobile HTTP RPC waiters, restore/overwrite of the wrong workspace tree, hostile MCP client shapes crashing mid-turn, and auth left stuck in connecting. None duplicate open #298–#306 claims.

Validation

  • Targeted new suites green
  • Touched files Biome-clean
  • bun run lint / bun run typecheck / bun run docs:check clean
  • Full bun run test: all 677 files passed (Bun 1.4.0-canary)
Open in Web View Automation 

Cursor Agent and others added 3 commits · 19 hours ago

View commits
  • test: cover runtime archive, HTTP RPC timeout, and backup containment5d36f9d
  • test: satisfy platform boundary and unflake draft prune fixturesd085920
  • Merge remote-tracking branch 'origin/main' into pr-autosync70b038b
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-3200

Only the target repository owner can merge this pull request.

Sign in to comment.

Stack

2/2
1

Merge readiness

Ahead3
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 runtime archive, HTTP RPC timeout, and backup containment

#307 main ← cursor/missing-test-coverage-3200

Updated 19 hours ago

open