Skip to content

fix(test): prevent detect-agent property test flake#899

Merged
BYK merged 1 commit into
mainfrom
fix/detect-agent-property-flake
Apr 30, 2026
Merged

fix(test): prevent detect-agent property test flake#899
BYK merged 1 commit into
mainfrom
fix/detect-agent-property-flake

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 30, 2026

Summary

  • Excludes boolean-ish garbage names (no, on, off, yes, true, false, 0, 1) from agentNameArb in detect-agent.property.test.ts

Problem

Follow-up to #896. The agentNameArb arbitrary could randomly generate short strings like "no" or "on" that match FALSY_GARBAGE_RE / TRUTHY_GARBAGE_RE. When these appeared in compound property tests (e.g. "no/1.2.3/agent"), normalizeAgent would short-circuit without extracting version/role, causing the unconditional expect(result!.version).toBe(version) assertion to fail.

Caught by Cursor BugBot.

…m agentNameArb

The agentNameArb arbitrary could generate strings like 'no', 'on', 'off',
'yes' that match TRUTHY_GARBAGE_RE or FALSY_GARBAGE_RE. When these appeared
in compound tests, normalizeAgent short-circuits without extracting version
or role, causing unconditional version/role assertions to fail.
@BYK BYK added the bug Something isn't working label Apr 30, 2026
@BYK BYK enabled auto-merge (squash) April 30, 2026 23:29
@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

6461 passed | Total: 6461 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +51
Passed Tests 📈 +51
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 13257 uncovered lines.
❌ Project coverage is 75.95%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    75.97%    75.95%    -0.02%
==========================================
  Files          295       295         —
  Lines        55045     55120       +75
  Branches         0         0         —
==========================================
+ Hits         41819     41863       +44
- Misses       13226     13257       +31
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 1fe8b4e into main Apr 30, 2026
25 checks passed
@BYK BYK deleted the fix/detect-agent-property-flake branch April 30, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant