بنقرة واحدة
wire-into-lifespan
Wires enable_tracing() into the FastAPI lifespan and adds manual trace wrapping imports to main.py.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Wires enable_tracing() into the FastAPI lifespan and adds manual trace wrapping imports to main.py.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Deploy agents to OpenShift with auto-detected cluster config and refresh MLflow tracking tokens.
Add integration deployment tests (health-check on OpenShift) to any agent in the agentic-starter-kits repo — standard, external-registry, or pre-deployed. Creates conftest.py, test_deployment.py, __init__.py, adds test-integration Makefile target, and updates the CI workflow matrix. Use when implementing integration tests, deployment tests, or health-check tests for a new agent.
Validate whether a new agent template or example belongs in the agentic-starter-kits repo. Two modes: idea mode (interactive questionnaire, no code yet) or existing agent mode (auto-extract from code). Produces a GitHub Discussion draft with fit score and recommendations. Use when proposing a new agent, reviewing an existing contribution's fit, or before writing code for a new template.
Add behavioral testing (pytest + EvalHub) to an agent in the agentic-starter-kits repo. Covers runner compatibility, test files, golden queries, thresholds, EvalHub fixture, Containerfile, docs, and MLflow tracing verification. Use when implementing behavioral tests for a new agent or when the user mentions btest, behavioral tests, eval coverage, or test harness integration.
Adds manual MLflow trace wrapping for tool and agent spans in Level B and C agents where autolog doesn't cover everything.
Researches and classifies a framework's MLflow autolog support level (A, B, or C) to determine what manual tracing is needed.
| name | wire-into-lifespan |
| description | Wires enable_tracing() into the FastAPI lifespan and adds manual trace wrapping imports to main.py. |
| argument-hint | <agent_path> |
| disable-model-invocation | true |
Usage:
/wire-into-lifespan <agent_path>Example:/wire-into-lifespan agents/autogen/chat_agent
You are connecting the tracing.py module to the agent's FastAPI app so that tracing is initialized at startup.
The agent path is: $ARGUMENTS
You also need the package name and coverage level (A, B, or C). If not provided, determine them by reading the agent's pyproject.toml and src/ directory.
main.pyRead <agent_path>/main.py to understand:
lifespan() functionAdd the import at the top of main.py, near the other package imports:
Level A (full autolog):
from <package_name>.tracing import enable_tracing
Level B or C (needs manual wrapping):
from <package_name>.tracing import enable_tracing, wrap_func_with_mlflow_trace
enable_tracing() to the lifespanAdd enable_tracing() as the first call inside the lifespan() async context manager, before any agent initialization:
@asynccontextmanager
async def lifespan(app: FastAPI):
enable_tracing() # <-- ADD THIS LINE
# ... existing agent initialization code ...
yield
# ... existing cleanup code ...
This placement ensures tracing is configured before any autolog-patched code runs.
wrap_func_with_mlflow_trace (Level B and C only)Skip this step for Level A — autolog handles everything.
For Level B/C, you need to wrap agent and tool functions with trace spans. Where you add the wrapping depends on how the agent initializes its components. Read the agent's code to find:
Find where tools are registered or instantiated. Wrap each tool's callable:
Pattern 1 — Tool objects with _run method (CrewAI-style, Level B):
# In crew.py or wherever tools are created
tool._run = wrap_func_with_mlflow_trace(tool._run, span_type="tool", name=tool.name)
Pattern 2 — Tool functions registered by name (Vanilla Python-style, Level C):
# In agent.py or main.py, wherever tools are registered
func = wrap_func_with_mlflow_trace(func, span_type="tool")
agent.register_tool(name, func)
Find the main agent entry point (the function that runs the full agent loop) and wrap it:
agent.query = wrap_func_with_mlflow_trace(agent.query, span_type="agent")
# or
agent.run = wrap_func_with_mlflow_trace(agent.run, span_type="agent")
Check if _handle_stream in main.py creates the agent differently from _handle_chat. If it does (e.g., creates a new agent instance directly instead of using the closure), the wrapping must be duplicated in the streaming path.
Reference: In the Vanilla Python agent, _handle_stream creates AIAgent directly and wraps tools + agent.query inside the run_agent() function. See agents/vanilla_python/openai_responses_agent/main.py, search for def run_agent().
Read these to see the wiring patterns in practice:
agents/vanilla_python/openai_responses_agent/main.py — Level C wiring (search for import enable_tracing, enable_tracing() in lifespan(), and run_agent() in _handle_stream)agents/langgraph/react_agent/main.py — Level A wiring (search for import enable_tracing and enable_tracing() in lifespan())agents/crewai/websearch_agent/main.py — Level B wiring (search for import enable_tracing and enable_tracing() in lifespan())agents/crewai/websearch_agent/src/crewai_web_search/crew.py — Level B tool wrapping (search for wrap_func_with_mlflow_trace in ai_assistant())enable_tracing() is called before agent initialization in lifespan()main.py with other package importswrap_func_with_mlflow_trace is importedmain.py — all MLflow interaction goes through tracing.pyBefore finishing, check whether this skill file needs updating. If any of the following are true, propose the specific changes to the user and only update this file if they approve:
If nothing needed changing, move on.