Home

mweinbach / agent-coworker

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

test: cover MCP OAuth failures, auth busy gates, and settings fan-out

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

Summary

Adds focused regression coverage for residual high-risk paths that are still untested on main and not claimed by open coverage PRs #298–#304.

Risky behavior now covered

  • MCP auto-OAuth idle timeout: when a captured OAuth code is consumed but the session stays busy past expiresAt, completion abandons without token exchange (pending remains; no success event).
  • MCP auto-OAuth exchange failure: token exchange errors emit mcp_server_auth_result ok:false / mode:"error" and clear connecting so later auth is not stuck.
  • Provider auth busy gate: authorize / callback / logout / copyApiKey emit busy and skip side effects while a turn is running.
  • JSON-RPC cowork/provider/auth/copyApiKey wire gate: missing provider or sourceProvider returns invalidParams before session work.
  • Desktop setPerWorkspaceSettings(false) fan-out: switching shared→per-workspace off copies settings into other workspaces and applies defaults to their active threads.

Test files added/updated

  • test/mcp.auth-flow.test.ts (+ scratchRoots migration / platform-boundary baseline shrink)
  • test/session/agentSession.provider.test.ts
  • test/jsonrpc.routes.review-fixes.test.ts
  • apps/desktop/test/workspace-settings-sync.defaults.test.ts
  • CI stabilizers: apps/desktop/test/research-readiness.test.tsx, apps/mobile/bun.lock, test/platform-boundary.baseline.json

Why this reduces regression risk

These paths sit on auth completion, busy/permission gating, JSON-RPC validation, and cross-workspace settings propagation. Failures here strand OAuth (single-use codes), leave connecting stuck, accept invalid copy-key requests, or leave other-workspace threads on stale config — all high blast-radius without needing UI snapshots.

Validation

  • Targeted suites green
  • bunx biome check on touched files
  • bun run lint / bun run typecheck / bun run docs:check green
  • Full bun run test: all 672 files passed (Bun canary)
Open in Web View Automation 

Cursor Agent and others added 3 commits · 19 hours ago

View commits
  • test: cover MCP OAuth failure paths, auth busy gates, and settings fan-outb5c2037
  • test: migrate MCP auth-flow temps to scratchRoots232737e
  • Merge remote-tracking branch 'origin/main' into pr-autosync7ffcfe5
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-2f3c

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 MCP OAuth failures, auth busy gates, and settings fan-out

#305 main ← cursor/missing-test-coverage-2f3c

Updated 19 hours ago

open