The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(display): encode provenance contract in tilde assertions
Hermes Agentab1a6d016a88
diff --git a/tests/test_tui_gateway_server.py b/tests/test_tui_gateway_server.pyindex 0fca69f3e8c..4c758cca360 100644--- a/tests/test_tui_gateway_server.py+++ b/tests/test_tui_gateway_server.py@@ -10868,7 +10868,7 @@ def test_slash_exec_r7_read_commands_use_metadata_mirror_flag_on(monkeypatch):"history": "live question from state db","prompt": "host system prompt","status": "Tokens: 140",- "context": "Context usage: ~80 / 1,000 tokens",+ "context": "Context usage: 80 / 1,000 tokens","tools": "terminal","help": "/status",}@@ -10886,6 +10886,16 @@ def test_slash_exec_r7_read_commands_use_metadata_mirror_flag_on(monkeypatch):assert expected in resp["result"]["output"]assert "stale parent mirror" not in resp["result"]["output"]assert "(._.)" not in resp["result"]["output"]+ mirrored_usage = server._sessions["sid"]["_metadata_mirror"]["usage"]+ for estimated in (True, False):+ mirrored_usage["context_estimated"] = estimated+ mirrored_usage["context_source"] = "local_estimate" if estimated else "provider_usage"+ response = server.handle_request({+ "id": "context-provenance", "method": "slash.exec",+ "params": {"command": "context", "session_id": "sid"},+ })+ mark = "~" if estimated else ""+ assert f"Context usage: {mark}80 / 1,000 tokens ({mark}8.0%)" in response["result"]["output"]finally:server._sessions.pop("sid", None)diff --git a/ui-tui/src/__tests__/appChromeStatusRule.test.tsx b/ui-tui/src/__tests__/appChromeStatusRule.test.tsxindex 500e5924dc3..06a6883c5ad 100644--- a/ui-tui/src/__tests__/appChromeStatusRule.test.tsx+++ b/ui-tui/src/__tests__/appChromeStatusRule.test.tsx@@ -114,7 +114,10 @@ describe('StatusRule session title', () => {usage: { ...baseProps.usage, context_estimated: estimated }}))- expect(text.includes('~')).toBe(estimated)+ const context = text.match(/(~?\d+(?:\.\d+)?k(?:\/\d+k| tok))/)?.[1]++ expect(context, `context must render at ${cols} columns`).toBeTruthy()+ expect(context?.startsWith('~')).toBe(estimated)}}})