Home

mweinbach / agent-coworker

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

test: cover runtime tool-env fail-closed, MCP retries, and auth copy gates

open
Stack 2/2
#304 opened by cursor[bot]cursor/missing-test-coverage-5a3d→main
Conversation3
cursor[bot]
Commits
3
Files changed6
opened this pull request
Author
· 6 days ago

Summary

Adds focused regression coverage for residual high-risk seams outside open coverage PRs #298–#303 (main tip still at fa5c0f68). Also refreshes canary mobile lockfile + research-readiness desktop bridge stabilizers used by CI.

Risky behavior now covered

  • Cowork runtime tool env fail-closed: missing/untrusted COWORK_RUNTIME_DIR strips all COWORK_RUNTIME_* keys and logs a block; disable flag leaves env untouched; instruction rendering requires NODE_MODULES and includes optional Node/Python/soffice paths.
  • MCP connect retry/backoff: transient failures sleep with increasing backoff, exhaust attempts with a counted error, and invalid retries fall back to the default of 3.
  • Control-session bootstrap budget exhaustion: when socket ready consumes the full wait budget, waitForControlSession returns false without treating a pending bootstrap as ready.
  • Provider API-key copy validation: non-OpenCode sibling pairs and unsupported providers are rejected with validation_failed before any connect attempt.

Test files added/updated

  • test/coworkRuntime.prepareToolEnv.test.ts (added)
  • test/mcp.retry.test.ts (added)
  • apps/desktop/test/control-socket.ensure.test.ts (updated)
  • test/session/agentSession.provider.test.ts (updated)
  • apps/desktop/test/research-readiness.test.tsx (CI stabilizer)
  • apps/mobile/bun.lock (canary lockfile refresh)

Why these tests materially reduce regression risk

These paths gate first-turn tooling availability, cold-start control readiness, and cross-provider auth key movement. Silent strip/retry/budget mistakes and over-broad key-copy acceptance are easy to regress without direct assertions and have large blast radius across agent turns and desktop startup.

Validation

  • Targeted suites green
  • Touched files Biome-clean (biome check)
  • bun run lint, bun run typecheck, bun run docs:check clean
  • Full bun run test: all 674 files passed (Bun 1.4.0-canary)

Notes

Avoided duplicating open #298–#303 seams. Deferred control-sync timeout silent path still depends on #298’s timeout override landing on main.

Open in Web View Automation 

Cursor Agent and others added 3 commits · 19 hours ago

View commits
  • test: cover runtime tool-env fail-closed, MCP retries, and auth copy gatese9157a9
  • style: format prepareToolEnv coverage test for Biome1e4ab5d
  • Merge remote-tracking branch 'origin/main' into pr-autosyncb33b81e
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-5a3d

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 tool-env fail-closed, MCP retries, and auth copy gates

#304 main ← cursor/missing-test-coverage-5a3d

Updated 19 hours ago

open