@@ -785,6 +785,65 @@ def test_selector_preview_caps_tool_selection_to_medium(self, client: TestClient
785785 assert data ["step_type" ] == "tool-selection"
786786 assert data ["served_tier" ] == "MEDIUM"
787787
788+ def test_selector_preview_caps_claude_code_title_sidechannel_to_simple (self , client : TestClient ) -> None :
789+ resp = client .post ("/v1/selector" , json = {
790+ "model" : "uncommon-route/auto" ,
791+ "messages" : [
792+ {
793+ "role" : "system" ,
794+ "content" : (
795+ "You are Claude Code. Generate a concise, sentence-case title "
796+ 'for this coding session. Return JSON with a single "title" field.'
797+ ),
798+ },
799+ {"role" : "user" , "content" : "帮我创建一个新的 Python 项目目录,叫 weather-cli" },
800+ ],
801+ "stream" : True ,
802+ })
803+
804+ assert resp .status_code == 200
805+ data = resp .json ()
806+ assert data ["served_tier" ] == "SIMPLE"
807+ assert data ["served_quality" ] == "economy"
808+ assert "tier-cap-preserved(title-generation)" in data ["reasoning" ]
809+
810+ def test_selector_preview_ignores_wrapper_context_for_followup_floor (self , client : TestClient ) -> None :
811+ resp = client .post ("/v1/selector" , json = {
812+ "model" : "uncommon-route/auto" ,
813+ "messages" : [
814+ {
815+ "role" : "user" ,
816+ "content" : [
817+ {
818+ "type" : "text" ,
819+ "text" : (
820+ "<system-reminder>\n "
821+ "Design a distributed platform with CRDTs, websocket fanout, "
822+ "permission boundaries, audit logging, and rollout plans.\n "
823+ "</system-reminder>"
824+ ),
825+ },
826+ {"type" : "text" , "text" : "hello" },
827+ ],
828+ },
829+ {"role" : "assistant" , "content" : "Hi." },
830+ {"role" : "user" , "content" : "帮我创建一个新的 Python 项目目录,叫 weather-cli" },
831+ ],
832+ "tools" : [{
833+ "type" : "function" ,
834+ "function" : {
835+ "name" : "bash" ,
836+ "description" : "Run shell commands" ,
837+ "parameters" : {"type" : "object" , "properties" : {}},
838+ },
839+ }],
840+ })
841+
842+ assert resp .status_code == 200
843+ data = resp .json ()
844+ assert "context-followup-floor=COMPLEX" not in data ["reasoning" ]
845+ assert data ["served_tier" ] in {"SIMPLE" , "MEDIUM" }
846+
788847 def test_route_preview_uses_live_selector_router (self , client : TestClient ) -> None :
789848 resp = client .post ("/v1/route-preview" , json = {
790849 "prompt" : "Create a Python CLI that fetches weather and add tests." ,
0 commit comments