Home

mweinbach / agent-coworker

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

test: cover idle eviction, MCP collision, and integrity path gaps

open
Stack 2/2
#299 opened by cursor[bot]cursor/missing-test-coverage-68eb→main
Conversation5
cursor[bot]
Commits
5
Files changed6
opened this pull request
Author
· last week

Summary

Adds focused regression coverage for residual high-risk gaps beyond open coverage PR #298, plus a small idle-eviction correctness fix for journal-backed sessions.

Risky behavior now covered

  • Session idle eviction with permanent journal sinks — disconnecting the last live client now arms idle clocks and evicts after timeout even when a journal: sink remains (busy sessions stay live; reattach clears idle).
  • Concurrent MCP tool-name collisions — servers whose names normalize to the same id remaps tools in config order (mcp__Foo_Bar__ping then mcp__Foo_Bar__ping_2) even when completion order is reversed.
  • Session-scoped MCP cache on sibling cold-start failure — when sessionId is set, otel/tool-env failure must not close cached workspace MCP connections used by other turns.
  • Runtime integrity path hardening — hard-linked runtime files and escaping symlinks fail closed on the fingerprint/verify path.

Test files added/updated

  • test/server/runtime/sessionRegistry.idleEviction.test.ts (new)
  • test/mcp.test.ts
  • test/agent.test.ts
  • test/coworkRuntime.test.ts
  • src/server/runtime/SessionRegistry.ts (tiny production fix: key idle remove/evict off countLiveConnectionSinks)

Why this reduces regression risk

These paths sit on shared concurrency/trust seams: session lifecycle memory leaks, unstable MCP tool ids across concurrent loads, accidental teardown of shared MCP caches mid-session, and signed-runtime bypass via hardlinks/symlinks. Unit coverage is deterministic and avoids UI snapshots.

Validation

  • Targeted: 114 pass
  • Touched files Biome-clean
  • bun run lint / typecheck / docs:check clean
  • Full bun run test: all 673 files passed

Notes

  • Leaves open PR #298 alone (deferred defaults, optimistic new-chat cleanup, integrity mid-verify race, etc.).
  • Residual still open after #298: integrity mid-hash tree mutation seam (needs after-verifyExactTree test hook distinct from #298’s wrap).
Open in Web View Automation 

Cursor Agent and others added 5 commits · 19 hours ago

View commits
  • fix: evict idle sessions despite permanent journal sinks6c0d3a5
  • test: cover MCP collision, session cache, and integrity path hardening0d942ed
  • test: bind idle-eviction harness to SessionRegistry prototypec6a39b2
  • chore: refresh mobile lockfile for canary bun install8bbd888
  • Merge remote-tracking branch 'origin/main' into pr-autosync10e478b
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-68eb

Only the target repository owner can merge this pull request.

Sign in to comment.

Stack

2/2
1

Merge readiness

Ahead5
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 idle eviction, MCP collision, and integrity path gaps

#299 main ← cursor/missing-test-coverage-68eb

Updated 19 hours ago

open