Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

test: cover ask sanitization, attachment decode, and spawn context

open
Stack 2/2
#338 opened by cursor[bot]cursor/missing-test-coverage-f2bc→main
Conversation0
cursor[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Add fail-closed coverage for ask/approval surfaces, attachment ingest, multimodal routing, and child-agent spawn context. Main is still at e2d5f95e; this does not duplicate open coverage PRs #331–#337.

Risky behavior now covered

  • Ask questions/options drop raw stream leftovers, extract embedded JSON questions, truncate readable long options, and refuse to render a single surviving option.
  • Persisted ask/approval feed lines strip a leading question: label before truncating, omit blank approval commands, and suppress provider debug payloads (raw stream part, response.*, obfuscation).
  • Attachment ingest rejects empty, mid-padded, and non-canonical base64 (YR==), plus oversize single/combined/count/upload limits.
  • Multimodal MIME mapping sends images only when the model supports them, and keeps audio/video/PDF on Google only.
  • Large-media guidance injects only for Google audio/video/PDF when the user asks to extract, and remaps 25MB errors for uploaded multimodal files.
  • Child-agent spawn requires a non-blank briefing in brief mode, maps only retired role aliases, and rejects malformed child reports.

Test files added/updated

  • test/shared/ask-prompt.test.ts
  • test/shared/projection-diagnostics.test.ts
  • test/shared/attachments-decode.test.ts
  • test/shared/multimodal-mime.test.ts
  • test/session/attachment-guidance-policy.test.ts
  • test/shared/agent-spawn-context.test.ts

Why these tests materially reduce regression risk

These helpers sit on user-visible ask/approval UI, journal/feed persistence, file ingest, and child-agent context. A silent change could leak raw provider payloads into questions, accept malformed attachments, send binary media to the wrong provider, or spawn a brief-mode agent without a briefing. Dedicated unit tests lock those gates without going through the full session harness.

Validation

  • Targeted 26 tests + test/platform-boundary.test.ts green
  • bun run check, bun run typecheck, bun run docs:check, and biome check on touched files are clean
  • Did not run the full suite on this host (historically truncates late)
Open in Web View Automation 
This branch can’t be merged automatically yet
Branch comparison failed — verify branches still exist in storage.
0 approving reviews
None yet
Checks
No checks recorded
Fast-forward
Source must contain the target branch tip
main ← cursor/missing-test-coverage-f2bc

Sign in to comment.

Stack

2/2
1

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.

Update README.md

#125 mobile-fixes ← main

Updated 4 months ago

merged
2

test: cover ask sanitization, attachment decode, and spawn context

#338 main ← cursor/missing-test-coverage-f2bc

Updated 2 weeks ago

open