Repository navigation
test(discord): remove thread cache reset - #124278
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 4:51 PM ET / 20:51 UTC. ClawSweeper reviewWhat this changesThe PR removes the Discord thread-starter cache reset test API and gives each resolver test a unique synthetic thread ID. Merge readinessKeep open. Current main still exposes and uses the test-only cache reset; this focused cleanup removes that seam while preserving isolation through the resolver’s real thread-ID cache key. Priority: P3 Review scores
Verification
How this fits togetherDiscord thread-starter resolution retrieves and caches the message that started a Discord thread before the message-context builder decides whether to include it in model context. The changed test now isolates calls using the same per-thread identity the runtime cache uses. flowchart LR
A[Incoming Discord thread] --> B[Message context builder]
B --> C[Thread starter resolver]
C --> D[Thread ID cache]
C --> E[Starter text and identity]
E --> F[Model context]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -5, Tests -2. Total -7 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Merge the deletion of the test-only barrel/cache reset and retain isolation through unique thread IDs, which exercise the cache’s actual runtime key. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR removes a test-only API rather than fixing a reported user-facing failure; source confirms the replacement isolation follows the real cache key. Is this the best way to solve the issue? Yes: unique thread IDs isolate test cases at the cache’s production boundary, unlike a barrel-exported reset that production callers do not need. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 37763e4d7ef8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for
Production delta: -5 lines. Tests: -2 lines. The cache reset and barrel export existed only for tests; cases now isolate through the production thread-ID cache key. No behavior, docs, changelog, schema, protocol, migration, or operator-state change. |
|
Merged via squash.
|
What Problem This Solves
Discord thread-starter tests exported a production cache-reset function solely to erase module state between cases. That made the production barrel and cache owner carry a test-only API, while the tests depended on an implementation detail rather than the cache's real thread-ID identity.
Why This Change Was Made
Each test resolution now uses a unique synthetic thread ID, which isolates cases through the production cache key. The test-only reset implementation and barrel export can therefore be deleted without changing cache behavior or weakening the existing starter-content assertions.
User Impact
None. This is an internal test cleanup; Discord thread-starter behavior and cache policy are unchanged.
Evidence
node scripts/run-vitest.mjs extensions/discord/src/monitor/threading.starter.test.ts— 11 passed.node scripts/check-changed.mjs -- extensions/discord/src/monitor/threading.cache.ts extensions/discord/src/monitor/threading.ts extensions/discord/src/monitor/threading.starter.test.ts— passed through the documented local fallback because no remote provider was ready.git diff --check— passed.