The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor: keep native MCP revision scoped to frozen tool settings
Teknium53d17f1c5b15
diff --git a/gateway/session_config.py b/gateway/session_config.pyindex c2f2f0d01a7..ddf0de43102 100644--- a/gateway/session_config.py+++ b/gateway/session_config.py@@ -72,9 +72,10 @@ async def config_get(connection, ref, params):'mtime': lambda: {'mtime': (home / 'config.yaml').stat().st_mtimeif (home / 'config.yaml').exists() else 0,# Frozen tool policy is not a live MCP reload request.- 'mcp_rev': hashlib.sha256((policy.config_json if policy else- json.dumps({k: cfg.get(k) for k in ('mcp', 'mcp_servers', 'tools')},- sort_keys=True)).encode()).hexdigest()[:12]},+ 'mcp_rev': hashlib.sha256(json.dumps({+ k: (policy.config() if policy else cfg).get(k)+ for k in ('mcp', 'mcp_servers', 'tools')},+ sort_keys=True).encode()).hexdigest()[:12]},'reasoning': lambda: _reasoning(agent, policy, cfg),'fast': lambda: {'value': 'fast' if (getattr(agent, 'service_tier', None) or(policy.config() if policy else cfg).get('agent', {}).get('service_tier'))diff --git a/tests/gateway/test_session_config_projection.py b/tests/gateway/test_session_config_projection.pyindex 3f2ebce1f9f..c93ae46777b 100644--- a/tests/gateway/test_session_config_projection.py+++ b/tests/gateway/test_session_config_projection.py@@ -21,6 +21,7 @@ def test_client_config_projection_keeps_session_policy_and_secrets_private(tmp_pconfig.update(voice={'record_key': 'ctrl+r', 'submit_mode': 'draft', 'api_key': 'PRIVATE_VOICE'},paste_collapse_threshold=12)config['display'].update(tui_theme='light', bell_on_complete=True)+ config['approvals'] = {'mode': 'manual'}(home / 'config.yaml').write_text(yaml.safe_dump(config))before = (home / 'config.yaml').read_bytes()full = await rpc(ws, 'config.get', key='full', session_id=sid)@@ -29,7 +30,15 @@ def test_client_config_projection_keeps_session_policy_and_secrets_private(tmp_passert full['result']['config']['display']['bell_on_complete'] is Truemtime = (await rpc(ws, 'config.get', key='mtime', session_id=sid))['result']assert mtime['mtime'] > 0 and mtime['mcp_rev']+ config['mcp_servers'] = {'later': {'command': 'not-started'}}+ (home / 'config.yaml').write_text(yaml.safe_dump(config))+ before = (home / 'config.yaml').read_bytes()+ assert (await rpc(ws, 'config.get', key='mtime', session_id=sid))['result']['mcp_rev'] == mtime['mcp_rev']+ assert (await rpc(ws, 'config.get', key='full'))['result']['config']['voice']['record_key'] == 'ctrl+r'assert (await rpc(ws, 'config.get', key='reasoning', session_id=sid))['result']['value'] == 'low'+ assert (await rpc(ws, 'config.get', key='project', session_id=sid, cwd=str(home)))['result']['cwd'] == str(home)+ assert (await rpc(ws, 'config.get', key='approvals.mode'))['result']['value'] == 'manual'+ assert (await rpc(ws, 'config.get', key='theme'))['result']['value'] == 'light'assert (await rpc(ws, 'config.set', key='busy', session_id=sid, value='queue'))['result']['value'] == 'queue'assert (await rpc(ws, 'config.get', key='busy', session_id=sid))['result']['value'] == 'queue'for method, params, reason in [