Skip to content

fix(addie): stabilise opinion-poll channel-router test#3103

Merged
bokelley merged 1 commit into
mainfrom
claude/issue-3101-fix-opinion-poll-flaky-test
Apr 25, 2026
Merged

fix(addie): stabilise opinion-poll channel-router test#3103
bokelley merged 1 commit into
mainfrom
claude/issue-3101-fix-opinion-poll-flaky-test

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Closes #3101

Summary

Two changes together eliminate the 'should ignore opinion requests' flake in server/tests/unit/addie-router.test.ts:

  1. Recorded fixture — replaces the live-API assertion with a vi.spyOn stub. The input ('What do you all think about the new IAB guidelines for CTV measurement?') sits on a semantic boundary (opinion poll, but IAB/CTV nouns are ad-tech adjacent) where Haiku is non-deterministic at default sampling temperature. Setting temperature: 0 was explored but the Anthropic SDK deprecates it for all models released after Opus 4.6 (including Haiku 4.5) — any non-1.0 value returns a 400. The fixture stubs client.messages.create once-per-test and asserts the routing logic (parseRouterResponse + channel-policy filter) without depending on live model output.

  2. Prompt clarification — adds an opinion-poll example to the ## Messages to Ignore list and the CRITICAL — CHANNEL SOURCE block, with an explicit carve-out preserving responses to AdCP-specific protocol questions. This makes the production routing more consistent on this class of input without over-suppressing legitimate "what does everyone think about the 3.0 schema?" questions.

Non-breaking justification: test-only change (vi.spyOn fixture) + prompt clarification with no semantic change to the ignore/respond binary for well-formed inputs; no schema, API, or protocol impact.

Pre-PR review

  • code-reviewer: approved (flagged temperature: 0 as a blocker — correctly identified the Anthropic SDK deprecation; also flagged missing changeset — both resolved)
  • prompt-engineer: approved (flagged AdCP-specific carve-out needed in new opinion-poll bullet — resolved)

Nits noted but not fixed

  • Duplicate phrasing between the ignore-list bullet and CRITICAL block (maintenance hazard — acceptable for now, worth a follow-up cleanup pass on the full channel-guidance section)
  • thirdPersonAddie regex misses some third-person phrasings (pre-existing, unrelated to this fix)

Session: https://claude.ai/code/session_017BFqhixgiLh2kjYMAzs4d2


Generated by Claude Code

Two changes together eliminate the 'should ignore opinion requests' flake:

1. Replace the live-API assertion with a vi.spyOn fixture — the input
   ('What do you all think about the new IAB guidelines for CTV
   measurement?') sits on a genuine semantic boundary where Haiku is
   non-deterministic at default sampling temperature. The fixture asserts
   the routing logic (parseRouterResponse + channel policy filter) without
   depending on model output.

2. Add an opinion-poll example to the channel-ignore guidelines in the
   routing prompt, with a carve-out preserving responses to AdCP-specific
   protocol questions, so production routing is more consistent on this
   class of input.

Non-breaking: test-only change + prompt clarification; no schema or API impact.

https://claude.ai/code/session_017BFqhixgiLh2kjYMAzs4d2
@bokelley bokelley marked this pull request as ready for review April 25, 2026 15:51
@bokelley bokelley force-pushed the claude/issue-3101-fix-opinion-poll-flaky-test branch from ff565af to 0e9ce0c Compare April 25, 2026 15:51
@bokelley bokelley merged commit 504575b into main Apr 25, 2026
13 checks passed
@bokelley bokelley deleted the claude/issue-3101-fix-opinion-poll-flaky-test branch April 25, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: addie-router LLM test 'should ignore opinion requests' non-deterministic

2 participants