Skip to content

Commit 2f136b2

Browse files
bloveclaude
andcommitted
fix(ag-ui): relative imports in subagents topic + deploy boot gate
The subagents topic's 'from src.streaming...' absolute imports resolve in dev (uvicorn runs from the topic dir) but not in the aggregated deployment layout, so every Railway image built since 2026-06-16 has crashed on import. 'railway up --detach' reports success at upload time, so CI never saw it: Railway kept serving the last good image, /agent/subagents has been 404 in production since June, and today's MAF topic could not appear. - Make both imports package-relative (works in dev and deployed). - Regenerate the staged deps/ copies. - Add a deploy boot gate: install the exact requirements union into a venv and 'import server' before railway up, so a boot failure fails the workflow instead of silently keeping a stale image. Verified: the boot repro that reproduced the production failure now prints 'BOOT OK' with 20 routes, including the MAF mount. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 1b89f15 commit 2f136b2

6 files changed

Lines changed: 26 additions & 4 deletions

File tree

.github/workflows/deploy-ag-ui.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ jobs:
4545
exit 1
4646
fi
4747
48+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
49+
with:
50+
python-version: '3.12'
51+
52+
- name: Boot gate — the aggregated server must import with the pinned deps
53+
# `railway up --detach` reports success at upload time, so a build or
54+
# boot failure on Railway is invisible to CI and the last good image
55+
# keeps serving. That hid a broken deploy for 2.5 months (subagents
56+
# topic 404 in prod since 2026-06-16; see blove/fix-ag-ui-deploy-boot).
57+
# Importing server.py against the exact requirements union reproduces
58+
# the container's boot locally and fails the workflow instead.
59+
working-directory: deployments/ag-ui-dev
60+
run: |
61+
python -m venv /tmp/bootgate-venv
62+
/tmp/bootgate-venv/bin/pip install --quiet -r requirements.txt
63+
AG_UI_INTERNAL_TOKEN=bootgate OPENAI_API_KEY=sk-bootgate \
64+
/tmp/bootgate-venv/bin/python -c "import server; print('boot ok:', len(server.app.routes), 'routes')"
65+
4866
- name: Install Railway CLI
4967
run: npm install -g @railway/cli@4.68.0
5068

cockpit/ag-ui/subagents/python/src/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from langgraph.prebuilt import ToolNode
2626
from langgraph_sdk import get_client
2727

28-
from src.streaming.subagent_stream_handler import SubagentStreamHandler
28+
from .streaming.subagent_stream_handler import SubagentStreamHandler
2929

3030
PROMPTS_DIR = Path(__file__).parent.parent / "prompts"
3131

cockpit/ag-ui/subagents/python/src/streaming/activity_emitting_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
native AG-UI ACTIVITY events at the bridge's 1:1 dispatch point. Owned transport
33
adapter — keeps the wire protocol-native without patching the bridge."""
44
from ag_ui_langgraph import LangGraphAgent
5-
from src.streaming.activity_transform import subagent_custom_to_activity
5+
from .activity_transform import subagent_custom_to_activity
66

77

88
class ActivityEmittingAgent(LangGraphAgent):

deployments/ag-ui-dev/deps/subagents/src/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from langgraph.prebuilt import ToolNode
2626
from langgraph_sdk import get_client
2727

28-
from src.streaming.subagent_stream_handler import SubagentStreamHandler
28+
from .streaming.subagent_stream_handler import SubagentStreamHandler
2929

3030
PROMPTS_DIR = Path(__file__).parent.parent / "prompts"
3131

deployments/ag-ui-dev/deps/subagents/src/streaming/activity_emitting_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
native AG-UI ACTIVITY events at the bridge's 1:1 dispatch point. Owned transport
33
adapter — keeps the wire protocol-native without patching the bridge."""
44
from ag_ui_langgraph import LangGraphAgent
5-
from src.streaming.activity_transform import subagent_custom_to_activity
5+
from .activity_transform import subagent_custom_to_activity
66

77

88
class ActivityEmittingAgent(LangGraphAgent):
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// SPDX-License-Identifier: MIT
2+
// AUTOGENERATED by libs/licensing/scripts/generate-public-key.mjs — do not edit.
3+
// Source: dev-fixture
4+
export const LICENSE_PUBLIC_KEY_HEX = '793132582f3d39dcd46cc6fd010c6c4b10f1225132e7de71fbcb45788ea5afde' as const;

0 commit comments

Comments
 (0)