fix(workspace): use SDK constant for agent-card readiness probe - #2193
Merged
hongmingwang-moleculeai merged 1 commit intoApr 27, 2026
Merged
Conversation
The initial-prompt readiness probe in workspace/main.py hardcoded the
pre-1.x well-known path. After the a2a-sdk 1.x bump the SDK started
mounting the agent card at the new canonical path (the value of
`a2a.utils.constants.AGENT_CARD_WELL_KNOWN_PATH`), so the probe
returned 404 every attempt and silently fell through to "server not
ready after 30s, skipping". Net effect: every workspace silently
dropped its `initial_prompt` from config.yaml — the agent never sent
the kickoff self-message, and users hit a fresh chat with no context.
Reported by an external user as "/.well-known/agent.json 404 — the
a2a-sdk agent card route was not being mounted at the expected path".
The route IS mounted; the probe was looking at the wrong place.
Fix imports `AGENT_CARD_WELL_KNOWN_PATH` from `a2a.utils.constants`
and uses it directly in the probe URL — the SDK constant is now the
single source of truth, so any future rename travels through
automatically.
Adds two static regression tests pinning the invariant:
1. No hardcoded `/.well-known/agent.json` literal anywhere in
main.py.
2. The probe URL fstring interpolates AGENT_CARD_WELL_KNOWN_PATH
(catches a "fix" that imports the constant for show but reverts
to a literal in the actual GET).
Verified manually inside ghcr.io/molecule-ai/workspace-template-langgraph
that AGENT_CARD_WELL_KNOWN_PATH == '/.well-known/agent-card.json' and
that `create_agent_card_routes(card)` mounts at exactly that path —
constant + mount are aligned in the runtime image, so the probe will
now find the server.
Full workspace test suite: 1209 passed, 2 xfailed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HongmingWang-Rabbit
requested a review
from hongmingwang-moleculeai
as a code owner
April 27, 2026 23:43
This was referenced Apr 28, 2026
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Jun 12, 2026
…2193 — mkdir /home/hongming perm denied halting prod rollout)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
External user reported
/.well-known/agent.json 404from the workspace runtime. The route IS mounted — the probe inworkspace/main.pywas looking at the wrong place.After the a2a-sdk 1.x bump, the SDK started mounting the agent card at the new canonical path (the value of
a2a.utils.constants.AGENT_CARD_WELL_KNOWN_PATH). The initial-prompt readiness probe still hardcoded the pre-1.x literal, so it 404'd every attempt and silently fell through to"Initial prompt: server not ready after 30s, skipping". Net effect: every workspace silently dropped itsinitial_promptfromconfig.yaml— the agent never sent the kickoff self-message, and users hit a fresh chat with no context.Fix
Import
AGENT_CARD_WELL_KNOWN_PATHfroma2a.utils.constantsand use it directly in the probe URL. The SDK constant is now the single source of truth — any future rename travels through automatically.Regression coverage
Two static invariants in
workspace/tests/test_agent_card_well_known_path.py:/.well-known/agent.jsonliteral anywhere inmain.py.AGENT_CARD_WELL_KNOWN_PATH(catches a "fix" that imports the constant for show but reverts to a literal in the actual GET).(A runtime cross-check against
create_agent_card_routes()was prototyped but the workspacetests/conftest.pymocks the entirea2apackage for executor unit tests, so the real SDK isn't reachable in this directory's pytest session. The two static checks are sufficient: by always following the SDK constant we follow any rename automatically; SDK's own constant↔mount alignment is the SDK's responsibility.)Verification
ghcr.io/molecule-ai/workspace-template-langgraph:latest:AGENT_CARD_WELL_KNOWN_PATH == '/.well-known/agent-card.json'andcreate_agent_card_routes(card)mounts at exactly that path — constant + mount are aligned in the runtime image.Test plan
initial_promptset inconfig.yaml, confirm the agent receives the kickoff self-message (no longer "server not ready after 30s, skipping" in container logs)🤖 Generated with Claude Code