fix(templates): register the local Agentex tracing processor so the developer UI traces tab shows spans - #512
michaelxu2288 wants to merge 2 commits into
Conversation
|
P1 This registers the Agentex tracing processor that #517 removes, and scaleapi/scale-agentex#430 deletes the server-side spans API it writes to, so whichever merges second leaves every scaffolded agent failing at import. The developer UI traces tab is served by #430's platform-backed reader instead, so this needs rebasing to the SGP processor only or closing as superseded. |
bc51c52 to
761833e
Compare
…eveloper UI traces tab shows spans
Every framework template registered only SGPTracingProcessorConfig, which
disables itself when SGP_API_KEY or SGP_ACCOUNT_ID is empty. Nothing else
creates a tracing processor, so spans derived by the unified harness were
never written to the backend /spans API and a scaffolded agent always showed
"No spans found for this task" in the developer UI, contradicting the README
("open the traces tab").
Register AgentexTracingProcessorConfig() ahead of the SGP block in all 16
framework templates (sync/default/temporal x openai-agents, pydantic-ai,
langgraph, claude-code, codex, plus the local-sandbox variant), fix a
sync-langgraph comment that claimed to register the Agentex processor, and
add a parametrized test asserting every framework template registers it.
Verified on a scaffolded sync Claude Code agent and a Temporal Claude Code
agent against a local backend: with the registration, message/turn spans
appear via POST /spans; without it, none do.
Claude-Session: https://claude.ai/code/session_01HCVKnA7LeJZ44nxZz1uzF3
…disabled The runtime treats an explicitly empty AGENTEX_BASE_URL as "no backend" and skips agent registration; registering the Agentex tracing processor unconditionally would then make every span export fail. Guard the registration on the same condition in all 16 framework templates. Claude-Session: https://claude.ai/code/session_01HCVKnA7LeJZ44nxZz1uzF3
8a049a7 to
ddb5d76
Compare
Comments Outside DiffThese findings could not be posted inline.
|
|
Thanks for flagging this. #517 and scaleapi/scale-agentex#430 were both closed without merging on 09-15, and If the Postgres spans API is still on its way out, I'm happy to close this or rework it against whatever replaces it. Just let me know which you'd prefer. |
Problem
The README's quickstart ends with "Investigate your agent's behavior by opening the traces tab", but every
agentex initframework template registers onlySGPTracingProcessorConfig, which disables itself whenSGP_API_KEY/SGP_ACCOUNT_IDare empty. No other code creates a tracing processor (TracingProcessorManagerstarts with an empty list), so the spans the unified harness derives are never written to the backend/spansAPI and the traces sidebar shows "No spans found for this task" for any locally scaffolded agent.Repro:
agentex init(Sync ACP + Claude Code, or any framework), run it against./dev.sh, send a message,GET /spans?task_id=<task>->[], backend log has noPOST /spans.Fix
Register
AgentexTracingProcessorConfig()ahead of the SGP block in all 16 framework templates (sync / default / temporal x openai-agents, pydantic-ai, langgraph, claude-code, codex, plus the OpenAI local-sandbox variant). SGP registration is unchanged. Fixes a comment insync-langgraphthat claimed to register the Agentex processor while registering SGP. Adds a parametrized test intests/lib/cli/test_init_templates.pyasserting every framework template registers the local processor.Verification
tests/lib/cli/test_init_templates.py: 42 passed (26 existing + 16 new).create_project_structureand byte-compiled.sync-claude-codetemplate against a local backend: message ->POST /spans,GET /spans?task_id=...returns themessage(AGENT_WORKFLOW) span. Same for atemporal-claude-codeagent (Turn 1/2/3 spans via the worker). Without the change: 0 spans.Follow-ups (not in this PR)
examples/register SGP only, and00_sync/020_streaming(which the README tells users to copy) registers nothing; happy to mirror this change there.AGENTEX_BASE_URLis set (idempotent, env kill-switch). That changes runtime behaviour for existing agents, so I kept this PR template-only; maintainers' call.This PR is not safe to merge until locally scaffolded agents send spans to the local backend when
AGENTEX_BASE_URLis unset.What we checked:
Summary
Scaffolded agents now send spans to the local Agentex backend, and
task/createwaits until its workflow starts. The PR also updates the SDK’s production URL and changes release and CI workflows.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Scaffolded agent with URL unset] --> B[Template enables tracing] B --> C[Processor creates Agentex] C --> D[Client selects production URL] D --> E[Span request goes to production]Reviews (3) · Last reviewed commit: "fix(templates): skip the local tracing p..."