mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
Fix remaining arch references found in second pass
- config/docker-compose.dev.yaml: ARCH_CONFIG_FILE → PLANO_CONFIG_FILE,
arch_config.yaml → plano_config.yaml, archgw_logs → plano_logs
- config/test_passthrough.yaml: container mount path
- tests/e2e/docker-compose.yaml: source file path (was still arch_config.yaml)
- cli/planoai/core.py: comment and log message
- crates/brightstaff/src/tracing/constants.rs: doc comment
- tests/{e2e,archgw}/common.py: get_arch_messages → get_plano_messages,
arch_state/arch_messages variables renamed
- tests/{e2e,archgw}/test_prompt_gateway.py: updated imports and usages
- demos/shared/test_runner/{common,test_demos}.py: same renames
- tests/e2e/test_model_alias_routing.py: docstring
- .dockerignore: archgw_modelserver → plano_modelserver
- demos/use_cases/claude_code_router/pretty_model_resolution.sh: container name
Note: x-arch-* HTTP header values and Rust constant names intentionally
preserved for backwards compatibility with existing deployments.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
db7b9ca2af
commit
1b00bdc49d
14 changed files with 65 additions and 65 deletions
|
|
@ -99,17 +99,17 @@ def get_data_chunks(stream, n=1):
|
|||
return chunks
|
||||
|
||||
|
||||
def get_arch_messages(response_json):
|
||||
arch_messages = []
|
||||
def get_plano_messages(response_json):
|
||||
plano_messages = []
|
||||
if response_json and "metadata" in response_json:
|
||||
# load arch_state from metadata
|
||||
arch_state_str = response_json.get("metadata", {}).get(ARCH_STATE_HEADER, "{}")
|
||||
# parse arch_state into json object
|
||||
arch_state = json.loads(arch_state_str)
|
||||
# load messages from arch_state
|
||||
arch_messages_str = arch_state.get("messages", "[]")
|
||||
# load plano_state from metadata
|
||||
plano_state_str = response_json.get("metadata", {}).get(ARCH_STATE_HEADER, "{}")
|
||||
# parse plano_state into json object
|
||||
plano_state = json.loads(plano_state_str)
|
||||
# load messages from plano_state
|
||||
plano_messages_str = plano_state.get("messages", "[]")
|
||||
# parse messages into json object
|
||||
arch_messages = json.loads(arch_messages_str)
|
||||
# append messages from arch gateway to history
|
||||
return arch_messages
|
||||
plano_messages = json.loads(plano_messages_str)
|
||||
# append messages from plano gateway to history
|
||||
return plano_messages
|
||||
return []
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ def httpserver_listen_address():
|
|||
from common import (
|
||||
PROMPT_GATEWAY_ENDPOINT,
|
||||
TEST_CASE_FIXTURES,
|
||||
get_arch_messages,
|
||||
get_plano_messages,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -83,10 +83,10 @@ def test_prompt_gateway(httpserver: HTTPServer):
|
|||
assert assistant_message["role"] == "assistant"
|
||||
assert "content" in assistant_message
|
||||
assert "weather" in assistant_message["content"]
|
||||
# now verify arch_messages (tool call and api response) that are sent as response metadata
|
||||
arch_messages = get_arch_messages(response_json)
|
||||
assert len(arch_messages) == 2
|
||||
tool_calls_message = arch_messages[0]
|
||||
# now verify plano_messages (tool call and api response) that are sent as response metadata
|
||||
plano_messages = get_plano_messages(response_json)
|
||||
assert len(plano_messages) == 2
|
||||
tool_calls_message = plano_messages[0]
|
||||
tool_calls = tool_calls_message.get("tool_calls", [])
|
||||
assert len(tool_calls) > 0
|
||||
tool_call = normalize_tool_call_arguments(tool_calls[0]["function"])
|
||||
|
|
|
|||
|
|
@ -98,17 +98,17 @@ def get_data_chunks(stream, n=1):
|
|||
return chunks
|
||||
|
||||
|
||||
def get_arch_messages(response_json):
|
||||
arch_messages = []
|
||||
def get_plano_messages(response_json):
|
||||
plano_messages = []
|
||||
if response_json and "metadata" in response_json:
|
||||
# load arch_state from metadata
|
||||
arch_state_str = response_json.get("metadata", {}).get(ARCH_STATE_HEADER, "{}")
|
||||
# parse arch_state into json object
|
||||
arch_state = json.loads(arch_state_str)
|
||||
# load messages from arch_state
|
||||
arch_messages_str = arch_state.get("messages", "[]")
|
||||
# load plano_state from metadata
|
||||
plano_state_str = response_json.get("metadata", {}).get(ARCH_STATE_HEADER, "{}")
|
||||
# parse plano_state into json object
|
||||
plano_state = json.loads(plano_state_str)
|
||||
# load messages from plano_state
|
||||
plano_messages_str = plano_state.get("messages", "[]")
|
||||
# parse messages into json object
|
||||
arch_messages = json.loads(arch_messages_str)
|
||||
# append messages from arch gateway to history
|
||||
return arch_messages
|
||||
plano_messages = json.loads(plano_messages_str)
|
||||
# append messages from plano gateway to history
|
||||
return plano_messages
|
||||
return []
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ services:
|
|||
- "12000:12000"
|
||||
- "19901:9901"
|
||||
volumes:
|
||||
- ../../demos/samples_python/weather_forecast/arch_config.yaml:/app/plano_config.yaml
|
||||
- ../../demos/samples_python/weather_forecast/plano_config.yaml:/app/plano_config.yaml
|
||||
- /etc/ssl/cert.pem:/etc/ssl/cert.pem
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ def test_anthropic_client_with_alias_streaming():
|
|||
|
||||
|
||||
def test_400_error_handling_with_alias():
|
||||
"""Test that 400 errors from upstream are properly returned by archgw"""
|
||||
"""Test that 400 errors from upstream are properly returned by plano"""
|
||||
logger.info(
|
||||
"Testing 400 error handling with arch.summarize.v1 and invalid parameter"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from common import (
|
|||
PROMPT_GATEWAY_ENDPOINT,
|
||||
LLM_GATEWAY_ENDPOINT,
|
||||
PREFILL_LIST,
|
||||
get_arch_messages,
|
||||
get_plano_messages,
|
||||
get_data_chunks,
|
||||
)
|
||||
|
||||
|
|
@ -117,11 +117,11 @@ def test_prompt_gateway(stream):
|
|||
assert len(choices) > 0
|
||||
assert "role" in choices[0]["message"]
|
||||
assert choices[0]["message"]["role"] == "assistant"
|
||||
# now verify arch_messages (tool call and api response) that are sent as response metadata
|
||||
arch_messages = get_arch_messages(response_json)
|
||||
print("arch_messages: ", json.dumps(arch_messages))
|
||||
assert len(arch_messages) == 2
|
||||
tool_calls_message = arch_messages[0]
|
||||
# now verify plano_messages (tool call and api response) that are sent as response metadata
|
||||
plano_messages = get_plano_messages(response_json)
|
||||
print("plano_messages: ", json.dumps(plano_messages))
|
||||
assert len(plano_messages) == 2
|
||||
tool_calls_message = plano_messages[0]
|
||||
print("tool_calls_message: ", tool_calls_message)
|
||||
tool_calls = tool_calls_message.get("content", [])
|
||||
cleaned_tool_call_str = cleanup_tool_call(tool_calls)
|
||||
|
|
@ -295,10 +295,10 @@ def test_prompt_gateway_param_tool_call(stream):
|
|||
assert len(choices) > 0
|
||||
assert "role" in choices[0]["message"]
|
||||
assert choices[0]["message"]["role"] == "assistant"
|
||||
# now verify arch_messages (tool call and api response) that are sent as response metadata
|
||||
arch_messages = get_arch_messages(response_json)
|
||||
assert len(arch_messages) == 2
|
||||
tool_calls_message = arch_messages[0]
|
||||
# now verify plano_messages (tool call and api response) that are sent as response metadata
|
||||
plano_messages = get_plano_messages(response_json)
|
||||
assert len(plano_messages) == 2
|
||||
tool_calls_message = plano_messages[0]
|
||||
tool_calls = tool_calls_message.get("tool_calls", [])
|
||||
assert len(tool_calls) > 0
|
||||
tool_call = normalize_tool_call_arguments(tool_calls[0]["function"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue