Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
feat(events): record what kind of exception ended a flow (#6982)
João Moura4b9b8bcbb984
diff --git a/docs/edge/ar/telemetry.mdx b/docs/edge/ar/telemetry.mdxindex d6ad1b350..6ea0f41af 100644--- a/docs/edge/ar/telemetry.mdx+++ b/docs/edge/ar/telemetry.mdx@@ -61,7 +61,7 @@ os.environ['OTEL_SDK_DISABLED'] = 'true'| نعم | سمات LLM | تشمل: الاسم، model_name، model، top_k، temperature، واسم فئة LLM. كلها بيانات تقنية غير شخصية. || نعم | محاولة نشر الطاقم باستخدام CLI الخاص بـ CrewAI | تشمل: حقيقة إجراء النشر ومعرّف الطاقم، وما إذا كان يحاول سحب السجلات، وما إذا بدأ النشر من أمر CLI أو من واجهة التشغيل TUI. لا تُسجَّل محتويات المشروع أو الطاقم. لا توجد بيانات شخصية. || نعم | بيئة التنفيذ | تشمل: مساعد البرمجة بالذكاء الاصطناعي الذي يشغّل العملية إن وُجد (واحد من قائمة ثابتة مثل `claude_code` أو `codex` أو `cursor` أو `unknown`)، ومكان تشغيل العملية (واحد من قائمة ثابتة مثل `ci` أو `container` أو `serverless` أو `interactive`)، و`project_id` من ملف `pyproject.toml` عند ضبطه. يتحقق الاكتشاف فقط مما إذا كانت متغيرات البيئة المعروفة مضبوطة، ولا يقرأ قيمها أبدًا. لا بيانات شخصية. |-| نعم | إشارات دورة حياة التدفق | تشمل: بدء التدفق، وما إذا اكتمل أو فشل، وما إذا فشلت إحدى دواله، وما إذا توقّف مؤقتًا لطلب إدخال أو ملاحظات بشرية، وما إذا كان البدء استئنافًا لتشغيل سابق، وما إذا فشلت دورة محادثة، ومدة تشغيل التدفق، وما إذا كان التدفق من التدفقات التي يشغّلها CrewAI داخليًا أم من كتابتك. يُسجَّل اسم التدفق (يجب ألا يتضمن معلومات شخصية)، كما هو الحال بالفعل عند إنشاء التدفق وتنفيذه. لا تُسجَّل أبدًا أسماء الدوال أو رسائل الأخطاء أو حالة التدفق. لا بيانات شخصية. |+| نعم | إشارات دورة حياة التدفق | تشمل: بدء التدفق، وما إذا اكتمل أو فشل، وما إذا فشلت إحدى طرقه، وما إذا توقف مؤقتًا لانتظار إدخال أو ملاحظات بشرية، وما إذا كان البدء تشغيلًا مستأنفًا، وما إذا فشل دور محادثة، ومدة تشغيل التدفق، وما إذا كان التدفق مما تشغّله CrewAI داخليًا أو مما كتبته أنت. ويُسجَّل اسم التدفق، كما هو الحال بالفعل لإنشاء التدفق وتنفيذه. وعند فشل تدفق أو إحدى طرقه، يُسجَّل **اسم فئة** الاستثناء (مثل `TimeoutError`) لتشخيص الأعطال — ولا تُسجَّل أبدًا رسالة الخطأ، التي قد تحتوي على مطالبات أو مخرجات النموذج أو مسارات ملفات أو بيانات اعتماد. ولا تُسجَّل أبدًا أسماء الطرق أو حالة التدفق. لا توجد بيانات شخصية. || نعم | إشارة مشاركة التتبع | تشمل: نجاح مشاركة دفعة من عمليات التتبع مع CrewAI AMP، وما إذا تمت المشاركة بشكل مجهول (قبل إنشاء حساب) أو مرتبطة بحسابك. ومثل كل span، تحمل أيضًا سمات بيئة التنفيذ الموضحة أعلاه (`project_id` عند تكوينه، ومساعد البرمجة، وبيئة التشغيل). يصف هذا الصف بيانات القياس عن بُعد الخاصة بالمشاركة فقط — وليس محتويات التتبع أو الوصول الذي تمنحه روابط التتبع المشتركة. لا تُسجَّل محتويات التتبع أو المدخلات أو المخرجات في هذه الإشارة. قبل مشاركة التتبعات، راجع الأسرار والبيانات الشخصية وإعدادات التنقيح والاحتفاظ في AMP. || لا | بيانات الوكيل الموسّعة | تشمل: وصف الهدف، نص الخلفية، معرّف ملف موجهات i18n. يجب على المستخدمين التأكد من عدم تضمين معلومات شخصية في حقول النص. || لا | معلومات المهمة التفصيلية | تشمل: وصف المهمة، وصف المخرجات المتوقعة، مراجع السياق. يجب على المستخدمين التأكد من عدم تضمين معلومات شخصية في هذه الحقول. |diff --git a/docs/edge/en/guides/frontend/a2ui.mdx b/docs/edge/en/guides/frontend/a2ui.mdxindex 9d3b9fdae..40612eedb 100644--- a/docs/edge/en/guides/frontend/a2ui.mdx+++ b/docs/edge/en/guides/frontend/a2ui.mdx@@ -7,7 +7,7 @@ mode: "wide"## The agent assembles the UI-[Tool-based rendering](/en/guides/frontend/tool-based-generative-ui) maps one tool to one component: the agent picks a component, you draw it. A2UI is the **declarative** tier of the [generative-UI spectrum](/en/guides/frontend/generative-ui#declarative) — instead of picking a single component, the agent **assembles a surface** by combining building blocks from a catalog you define.+[Tool-based rendering](/edge/en/guides/frontend/tool-based-generative-ui) maps one tool to one component: the agent picks a component, you draw it. A2UI is the **declarative** tier of the [generative-UI spectrum](/edge/en/guides/frontend/generative-ui#declarative) — instead of picking a single component, the agent **assembles a surface** by combining building blocks from a catalog you define.You still own the components. The agent can only use what is in your catalog, so it can never render something you did not ship. What the agent decides is the **layout and the data** — how those building blocks come together into a panel, and what goes in them.@@ -115,13 +115,13 @@ Both modes share the same frontend: one catalog, registered once on the provider## Related<CardGroup cols={3}>- <Card title="Generative UI" icon="wand-magic-sparkles" href="/en/guides/frontend/generative-ui">+ <Card title="Generative UI" icon="wand-magic-sparkles" href="/edge/en/guides/frontend/generative-ui">The full spectrum — A2UI is its declarative tier.</Card>- <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/en/guides/frontend/tool-based-generative-ui">+ <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/edge/en/guides/frontend/tool-based-generative-ui">Map one tool to one component (controlled).</Card>- <Card title="Agentic Generative UI" icon="list-check" href="/en/guides/frontend/agentic-generative-ui">+ <Card title="Agentic Generative UI" icon="list-check" href="/edge/en/guides/frontend/agentic-generative-ui">Render live agent state (controlled).</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/agentic-generative-ui.mdx b/docs/edge/en/guides/frontend/agentic-generative-ui.mdxindex 952cb98a8..29ea17aa5 100644--- a/docs/edge/en/guides/frontend/agentic-generative-ui.mdx+++ b/docs/edge/en/guides/frontend/agentic-generative-ui.mdx@@ -17,12 +17,12 @@ The pattern has two halves:The Flow's state reaches the frontend over AG-UI without you wiring up any transport. A state snapshot is emitted automatically at each step (method) boundary of the Flow, and you can push intermediate updates during a long-running step by calling `copilotkit_emit_state` explicitly. You subclass the state to add your own fields, update them in the Flow, and read them in React.<Note>-State-driven rendering requires a **Flow** with custom state (`Flow[AgentState]`). Crews are chat-oriented and do not expose custom state this way, so with a Crew use [tool rendering](/en/guides/frontend/tool-based-generative-ui) instead.+State-driven rendering requires a **Flow** with custom state (`Flow[AgentState]`). Crews are chat-oriented and do not expose custom state this way, so with a Crew use [tool rendering](/edge/en/guides/frontend/tool-based-generative-ui) instead.</Note>## Build a live task planner-This example builds a planner that breaks a request into about ten steps and streams them to the UI as a checklist. It assumes you already have a CrewAI server and a CopilotKit frontend wired up. If you do not, start with the [Frontend Overview](/en/guides/frontend/overview).+This example builds a planner that breaks a request into about ten steps and streams them to the UI as a checklist. It assumes you already have a CrewAI server and a CopilotKit frontend wired up. If you do not, start with the [Frontend Overview](/edge/en/guides/frontend/overview).<Steps>@@ -146,7 +146,7 @@ add_crewai_flow_fastapi_endpoint()```-See the [Frontend Overview](/en/guides/frontend/overview) for the full server, runtime, and provider setup, and remember to register the agent (here `task_planner`) in your CopilotKit runtime route.+See the [Frontend Overview](/edge/en/guides/frontend/overview) for the full server, runtime, and provider setup, and remember to register the agent (here `task_planner`) in your CopilotKit runtime route.</Step>@@ -190,19 +190,19 @@ function TaskPlan() {Reading state is the foundation. Two guides build directly on it:-- [Shared State](/en/guides/frontend/shared-state) adds the other direction: editing the agent's state from the UI and having the Flow pick up the change.-- [Predictive State](/en/guides/frontend/predictive-state-updates) streams a tool's in-progress arguments into state so the UI reflects work before it is committed.+- [Shared State](/edge/en/guides/frontend/shared-state) adds the other direction: editing the agent's state from the UI and having the Flow pick up the change.+- [Predictive State](/edge/en/guides/frontend/predictive-state-updates) streams a tool's in-progress arguments into state so the UI reflects work before it is committed.## Related<CardGroup cols={2}>- <Card title="Shared State" icon="arrows-rotate" href="/en/guides/frontend/shared-state">+ <Card title="Shared State" icon="arrows-rotate" href="/edge/en/guides/frontend/shared-state">Sync agent state and app UI in both directions.</Card>- <Card title="Predictive State" icon="gauge-high" href="/en/guides/frontend/predictive-state-updates">+ <Card title="Predictive State" icon="gauge-high" href="/edge/en/guides/frontend/predictive-state-updates">Stream in-progress tool arguments into state.</Card>- <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/en/guides/frontend/tool-based-generative-ui">+ <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/edge/en/guides/frontend/tool-based-generative-ui">Map agent tool calls to components.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/channels.mdx b/docs/edge/en/guides/frontend/channels.mdxindex b881ef6b1..e62e6db96 100644--- a/docs/edge/en/guides/frontend/channels.mdx+++ b/docs/edge/en/guides/frontend/channels.mdx@@ -7,7 +7,7 @@ mode: "wide"## Meet your users where they already are-The CrewAI agent you built in the [Overview](/en/guides/frontend/overview) does not have to live behind a web app. The same Crew or Flow can run as a bot inside a messaging platform. No rebuild, no second copy of your agent logic: the agent stays exposed over the [AG-UI protocol](https://docs.ag-ui.com), and a bot process drives it.+The CrewAI agent you built in the [Overview](/edge/en/guides/frontend/overview) does not have to live behind a web app. The same Crew or Flow can run as a bot inside a messaging platform. No rebuild, no second copy of your agent logic: the agent stays exposed over the [AG-UI protocol](https://docs.ag-ui.com), and a bot process drives it.CopilotKit's [Channels SDK](https://docs.copilotkit.ai/reference/channels) provides that bot process. It ships a platform-agnostic engine plus per-platform adapters.@@ -116,10 +116,10 @@ Slack and Discord have official Channels adapters (`@copilotkit/channels-slack`,## Related<CardGroup cols={2}>- <Card title="Frontend Overview" icon="browser" href="/en/guides/frontend/overview">+ <Card title="Frontend Overview" icon="browser" href="/edge/en/guides/frontend/overview">Serve your Crew or Flow over AG-UI — the foundation every channel builds on.</Card>- <Card title="Human-in-the-Loop" icon="user-check" href="/en/guides/frontend/human-in-the-loop">+ <Card title="Human-in-the-Loop" icon="user-check" href="/edge/en/guides/frontend/human-in-the-loop">Pause the agent to collect user approval or input mid-run.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/conversational-flows.mdx b/docs/edge/en/guides/frontend/conversational-flows.mdxindex c5e629ccd..2c12e7201 100644--- a/docs/edge/en/guides/frontend/conversational-flows.mdx+++ b/docs/edge/en/guides/frontend/conversational-flows.mdx@@ -18,7 +18,7 @@ Behind the AG-UI bridge, a CrewAI backend can take one of three shapes. KnowingConversational Flows are a newer CrewAI capability, and an important thing to be clear about up front: **they are Flows, not Crews.** They now run at full regular-Flow feature parity. This page introduces them and shows how they fit the rest of the frontend guides.<Note>-Reach for a Conversational Flow when you want native multi-turn conversation with CrewAI managing session state and history for you, rather than wiring turn and state handling into a regular Flow yourself. If you are new here, start with the [Frontend Overview](/en/guides/frontend/overview) for the base server, runtime, and provider setup.+Reach for a Conversational Flow when you want native multi-turn conversation with CrewAI managing session state and history for you, rather than wiring turn and state handling into a regular Flow yourself. If you are new here, start with the [Frontend Overview](/edge/en/guides/frontend/overview) for the base server, runtime, and provider setup.</Note>## Register a Conversational Flow@@ -66,25 +66,25 @@ This is the point to hold onto: **Conversational Flows run through the same evenThere is no Conversational-Flow-specific frontend API. Every feature in these guides works exactly the same way with a Conversational Flow as it does with a regular Flow, using the same hooks and components:<CardGroup cols={2}>- <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/en/guides/frontend/tool-based-generative-ui">+ <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/edge/en/guides/frontend/tool-based-generative-ui">Map agent tool calls to your React components.</Card>- <Card title="Agentic Generative UI" icon="list-check" href="/en/guides/frontend/agentic-generative-ui">+ <Card title="Agentic Generative UI" icon="list-check" href="/edge/en/guides/frontend/agentic-generative-ui">Render the Flow's live state as it works.</Card>- <Card title="Shared State" icon="arrows-rotate" href="/en/guides/frontend/shared-state">+ <Card title="Shared State" icon="arrows-rotate" href="/edge/en/guides/frontend/shared-state">Keep agent state and app UI in two-way sync.</Card>- <Card title="Human-in-the-Loop" icon="user-check" href="/en/guides/frontend/human-in-the-loop">+ <Card title="Human-in-the-Loop" icon="user-check" href="/edge/en/guides/frontend/human-in-the-loop">Pause the agent for user approval or input mid-turn.</Card>- <Card title="Predictive State" icon="gauge-high" href="/en/guides/frontend/predictive-state-updates">+ <Card title="Predictive State" icon="gauge-high" href="/edge/en/guides/frontend/predictive-state-updates">Stream in-progress tool arguments into state.</Card>- <Card title="Reasoning" icon="brain" href="/en/guides/frontend/reasoning">+ <Card title="Reasoning" icon="brain" href="/edge/en/guides/frontend/reasoning">Show the model's thinking in the chat.</Card>- <Card title="A2UI" icon="table-cells" href="/en/guides/frontend/a2ui">+ <Card title="A2UI" icon="table-cells" href="/edge/en/guides/frontend/a2ui">Render agent-authored UI from a component catalog.</Card></CardGroup>@@ -94,13 +94,13 @@ The only difference is on the backend: how you author the Flow (turn-based `stre## Related<CardGroup cols={2}>- <Card title="Frontend Overview" icon="browser" href="/en/guides/frontend/overview">+ <Card title="Frontend Overview" icon="browser" href="/edge/en/guides/frontend/overview">Wire a Crew or Flow to a Next.js frontend end to end.</Card>- <Card title="Generative UI" icon="wand-magic-sparkles" href="/en/guides/frontend/generative-ui">+ <Card title="Generative UI" icon="wand-magic-sparkles" href="/edge/en/guides/frontend/generative-ui">Render tool calls and agent state as custom components.</Card>- <Card title="Human-in-the-Loop" icon="user-check" href="/en/guides/frontend/human-in-the-loop">+ <Card title="Human-in-the-Loop" icon="user-check" href="/edge/en/guides/frontend/human-in-the-loop">Gate agent actions behind user approval.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/frontend-actions.mdx b/docs/edge/en/guides/frontend/frontend-actions.mdxindex 4a41d118d..a1fc0117e 100644--- a/docs/edge/en/guides/frontend/frontend-actions.mdx+++ b/docs/edge/en/guides/frontend/frontend-actions.mdx@@ -89,7 +89,7 @@ class AssistantFlow(Flow[CopilotKitState]):<Step title="Serve the Flow">-Expose the Flow over AG-UI with `add_crewai_flow_fastapi_endpoint(...)` and register it in the CopilotKit runtime, exactly as in the [Frontend Overview](/en/guides/frontend/overview). Once both are running, asking the assistant to "switch to dark mode" triggers `set_theme`, and the page flips.+Expose the Flow over AG-UI with `add_crewai_flow_fastapi_endpoint(...)` and register it in the CopilotKit runtime, exactly as in the [Frontend Overview](/edge/en/guides/frontend/overview). Once both are running, asking the assistant to "switch to dark mode" triggers `set_theme`, and the page flips.</Step>@@ -104,18 +104,18 @@ Expose the Flow over AG-UI with `add_crewai_flow_fastapi_endpoint(...)` and regi| **`handler`** | Runs code in the browser (a frontend action) || **`render`** | Draws UI for the tool call (generative UI) |-You can supply either one, or both. A `handler` with a `render` alongside it performs the action and draws UI while it runs. For render-only tools that just display the result of an agent action, see [Tool-Based Generative UI](/en/guides/frontend/tool-based-generative-ui).+You can supply either one, or both. A `handler` with a `render` alongside it performs the action and draws UI while it runs. For render-only tools that just display the result of an agent action, see [Tool-Based Generative UI](/edge/en/guides/frontend/tool-based-generative-ui).## Related<CardGroup cols={2}>- <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/en/guides/frontend/tool-based-generative-ui">+ <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/edge/en/guides/frontend/tool-based-generative-ui">Map agent tool calls to React components.</Card>- <Card title="Human-in-the-Loop" icon="user-check" href="/en/guides/frontend/human-in-the-loop">+ <Card title="Human-in-the-Loop" icon="user-check" href="/edge/en/guides/frontend/human-in-the-loop">Gate agent actions behind user approval.</Card>- <Card title="Shared State" icon="arrows-rotate" href="/en/guides/frontend/shared-state">+ <Card title="Shared State" icon="arrows-rotate" href="/edge/en/guides/frontend/shared-state">Keep agent state and your app UI in two-way sync.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/generative-ui.mdx b/docs/edge/en/guides/frontend/generative-ui.mdxindex b8e2da30b..9fd0ae628 100644--- a/docs/edge/en/guides/frontend/generative-ui.mdx+++ b/docs/edge/en/guides/frontend/generative-ui.mdx@@ -14,7 +14,7 @@ CopilotKit renders generative UI along a **spectrum**, from fully author-control| Tier | Who decides the UI | CrewAI mechanism || --- | --- | --- || **[Controlled](#controlled)** | You — a fixed set of components the agent picks from | `useRenderTool`, `useAgent`, reasoning |-| **[Declarative](#declarative)** | The agent — assembles a surface from *your* component catalog | [A2UI](/en/guides/frontend/a2ui) |+| **[Declarative](#declarative)** | The agent — assembles a surface from *your* component catalog | [A2UI](/edge/en/guides/frontend/a2ui) || **[Open-ended](#open-ended)** | An external tool/server invents the surface | MCP tools |The tiers compose freely; a single app usually mixes them.@@ -43,10 +43,10 @@ useRenderTool({```<Note>-`useRenderTool` renders a tool call. When a tool also needs to *run* code in the browser, use [`useFrontendTool`](/en/guides/frontend/frontend-actions) (a `handler`, with optional `render`).+`useRenderTool` renders a tool call. When a tool also needs to *run* code in the browser, use [`useFrontendTool`](/edge/en/guides/frontend/frontend-actions) (a `handler`, with optional `render`).</Note>-See [Tool-Based Generative UI](/en/guides/frontend/tool-based-generative-ui) for the full walkthrough, including progressive rendering as arguments stream, and [Backend Tool Rendering](/en/guides/frontend/tool-based-generative-ui#backend-tools) for tools your Crew or Flow executes server-side.+See [Tool-Based Generative UI](/edge/en/guides/frontend/tool-based-generative-ui) for the full walkthrough, including progressive rendering as arguments stream, and [Backend Tool Rendering](/edge/en/guides/frontend/tool-based-generative-ui#backend-tools) for tools your Crew or Flow executes server-side.### State rendering@@ -63,17 +63,17 @@ function TaskProgress() {}```-See [Agentic Generative UI](/en/guides/frontend/agentic-generative-ui) for streaming state from a Flow, and [Shared State](/en/guides/frontend/shared-state) for editing that state from the UI.+See [Agentic Generative UI](/edge/en/guides/frontend/agentic-generative-ui) for streaming state from a Flow, and [Shared State](/edge/en/guides/frontend/shared-state) for editing that state from the UI.### Reasoning-When the model reasons before answering, that thinking renders in the chat automatically. No component to write. See [Reasoning](/en/guides/frontend/reasoning).+When the model reasons before answering, that thinking renders in the chat automatically. No component to write. See [Reasoning](/edge/en/guides/frontend/reasoning).## DeclarativeThe agent goes beyond picking a component: it **assembles a surface** by combining building blocks from a catalog *you* define. You still own the components (the agent can only use what is in your catalog), but the layout is the agent's.-This is [A2UI](/en/guides/frontend/a2ui). You register a catalog on the provider:+This is [A2UI](/edge/en/guides/frontend/a2ui). You register a catalog on the provider:```tsx<CopilotKit runtimeUrl="/api/copilotkit" agent="assistant" a2ui={{ catalog }}>@@ -81,7 +81,7 @@ This is [A2UI](/en/guides/frontend/a2ui). You register a catalog on the provider</CopilotKit>```-The agent then builds surfaces from that catalog — either dynamically (it designs the layout from the conversation) or from a fixed schema your backend fills with data. See [A2UI](/en/guides/frontend/a2ui) for both modes and error recovery.+The agent then builds surfaces from that catalog — either dynamically (it designs the layout from the conversation) or from a fixed schema your backend fills with data. See [A2UI](/edge/en/guides/frontend/a2ui) for both modes and error recovery.## Open-ended@@ -92,16 +92,16 @@ MCP tool calls surface as standard tool-call UI — render them with `useRenderT## Related<CardGroup cols={2}>- <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/en/guides/frontend/tool-based-generative-ui">+ <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/edge/en/guides/frontend/tool-based-generative-ui">Map agent tool calls to components (controlled).</Card>- <Card title="Agentic Generative UI" icon="list-check" href="/en/guides/frontend/agentic-generative-ui">+ <Card title="Agentic Generative UI" icon="list-check" href="/edge/en/guides/frontend/agentic-generative-ui">Render live agent state (controlled).</Card>- <Card title="A2UI" icon="table-cells" href="/en/guides/frontend/a2ui">+ <Card title="A2UI" icon="table-cells" href="/edge/en/guides/frontend/a2ui">Let the agent assemble surfaces from your catalog (declarative).</Card>- <Card title="Reasoning" icon="brain" href="/en/guides/frontend/reasoning">+ <Card title="Reasoning" icon="brain" href="/edge/en/guides/frontend/reasoning">Render the agent's thinking.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/human-in-the-loop.mdx b/docs/edge/en/guides/frontend/human-in-the-loop.mdxindex 61f9c6749..75fa5e128 100644--- a/docs/edge/en/guides/frontend/human-in-the-loop.mdx+++ b/docs/edge/en/guides/frontend/human-in-the-loop.mdx@@ -74,7 +74,7 @@ class HumanInTheLoopFlow(Flow[CopilotKitState]):<Step title="Serve the Flow over AG-UI">-Expose the Flow from your FastAPI server with `add_crewai_flow_fastapi_endpoint`, the same way as every other agent. See [Frontend Overview](/en/guides/frontend/overview) for the full server, runtime, and provider setup.+Expose the Flow from your FastAPI server with `add_crewai_flow_fastapi_endpoint`, the same way as every other agent. See [Frontend Overview](/edge/en/guides/frontend/overview) for the full server, runtime, and provider setup.```python# server.py@@ -179,13 +179,13 @@ Once the user clicks Confirm, `respond()` fires, the run resumes, and the Flow's## Related<CardGroup cols={2}>- <Card title="Frontend Actions" icon="bolt" href="/en/guides/frontend/frontend-actions">+ <Card title="Frontend Actions" icon="bolt" href="/edge/en/guides/frontend/frontend-actions">Let the agent call functions that run in the browser.</Card>- <Card title="Shared State" icon="arrows-rotate" href="/en/guides/frontend/shared-state">+ <Card title="Shared State" icon="arrows-rotate" href="/edge/en/guides/frontend/shared-state">Keep agent state and your app UI in two-way sync.</Card>- <Card title="Agentic Generative UI" icon="list-check" href="/en/guides/frontend/agentic-generative-ui">+ <Card title="Agentic Generative UI" icon="list-check" href="/edge/en/guides/frontend/agentic-generative-ui">Render live agent state as custom components.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/overview.mdx b/docs/edge/en/guides/frontend/overview.mdxindex 326c91721..123f03213 100644--- a/docs/edge/en/guides/frontend/overview.mdx+++ b/docs/edge/en/guides/frontend/overview.mdx@@ -12,16 +12,16 @@ CrewAI runs your agents. [CopilotKit](https://copilotkit.ai) gives them a fronteThe two connect through the [AG-UI protocol](https://docs.ag-ui.com). The `ag-ui-crewai` package exposes any Crew or Flow as an AG-UI endpoint. CopilotKit's React hooks and components consume that endpoint. This unlocks experiences that go well beyond a chat box:<CardGroup cols={2}>- <Card title="Generative UI" icon="wand-magic-sparkles" href="/en/guides/frontend/generative-ui">+ <Card title="Generative UI" icon="wand-magic-sparkles" href="/edge/en/guides/frontend/generative-ui">Render agent tool calls and state as your own React components.</Card>- <Card title="Human-in-the-Loop" icon="user-check" href="/en/guides/frontend/human-in-the-loop">+ <Card title="Human-in-the-Loop" icon="user-check" href="/edge/en/guides/frontend/human-in-the-loop">Pause the agent to collect user approval or input mid-run.</Card>- <Card title="Shared State" icon="arrows-rotate" href="/en/guides/frontend/shared-state">+ <Card title="Shared State" icon="arrows-rotate" href="/edge/en/guides/frontend/shared-state">Keep agent state and your app UI in two-way sync.</Card>- <Card title="Channels" icon="slack" href="/en/guides/frontend/channels">+ <Card title="Channels" icon="slack" href="/edge/en/guides/frontend/channels">Run the same agent as a Slack, Discord, or Teams bot.</Card></CardGroup>@@ -45,7 +45,7 @@ This guide covers the **self-hosted** path: you run the CrewAI agent server your</Note><Note>-CrewAI runs behind AG-UI in three shapes: regular **Flows** (used throughout these guides), **[Conversational Flows](/en/guides/frontend/conversational-flows)** (native, session-aware, turn-based, at full feature parity), and **Crews** (basic chat). The frontend in this section is identical across them — only the backend authoring and registration differ.+CrewAI runs behind AG-UI in three shapes: regular **Flows** (used throughout these guides), **[Conversational Flows](/edge/en/guides/frontend/conversational-flows)** (native, session-aware, turn-based, at full feature parity), and **Crews** (basic chat). The frontend in this section is identical across them — only the backend authoring and registration differ.</Note>## Integration guide@@ -223,16 +223,16 @@ import { CopilotChat } from "@copilotkit/react-core/v2";## Where to go next<CardGroup cols={2}>- <Card title="Generative UI" icon="wand-magic-sparkles" href="/en/guides/frontend/generative-ui">+ <Card title="Generative UI" icon="wand-magic-sparkles" href="/edge/en/guides/frontend/generative-ui">Render tool calls and agent state as custom components.</Card>- <Card title="Frontend Actions" icon="bolt" href="/en/guides/frontend/frontend-actions">+ <Card title="Frontend Actions" icon="bolt" href="/edge/en/guides/frontend/frontend-actions">Let the agent call functions that run in the browser.</Card>- <Card title="Human-in-the-Loop" icon="user-check" href="/en/guides/frontend/human-in-the-loop">+ <Card title="Human-in-the-Loop" icon="user-check" href="/edge/en/guides/frontend/human-in-the-loop">Gate agent actions behind user approval.</Card>- <Card title="Predictive State" icon="gauge-high" href="/en/guides/frontend/predictive-state-updates">+ <Card title="Predictive State" icon="gauge-high" href="/edge/en/guides/frontend/predictive-state-updates">Stream in-progress state to the UI as the agent works.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/predictive-state-updates.mdx b/docs/edge/en/guides/frontend/predictive-state-updates.mdxindex ed9204311..8967628fa 100644--- a/docs/edge/en/guides/frontend/predictive-state-updates.mdx+++ b/docs/edge/en/guides/frontend/predictive-state-updates.mdx@@ -22,13 +22,13 @@ Both patterns read the agent's state from the frontend, but they solve different| Pattern | What it does || --- | --- || **Predictive state** | One-way. Streams an in-progress tool argument into a state field so the UI updates *during* generation, before the call completes. |-| **[Shared State](/en/guides/frontend/shared-state)** | Two-way. The UI reads *and writes* the agent's committed state, keeping app and agent in sync across turns. |+| **[Shared State](/edge/en/guides/frontend/shared-state)** | Two-way. The UI reads *and writes* the agent's committed state, keeping app and agent in sync across turns. |-Reach for predictive state when you want an optimistic, in-flight preview of what the agent is producing. Reach for [Shared State](/en/guides/frontend/shared-state) when the user needs to edit that state back.+Reach for predictive state when you want an optimistic, in-flight preview of what the agent is producing. Reach for [Shared State](/edge/en/guides/frontend/shared-state) when the user needs to edit that state back.## Walkthrough-This assumes you already have a Crew or Flow served over AG-UI and a CopilotKit frontend wired up. If not, start with the [Frontend Overview](/en/guides/frontend/overview).+This assumes you already have a Crew or Flow served over AG-UI and a CopilotKit frontend wired up. If not, start with the [Frontend Overview](/edge/en/guides/frontend/overview).<Steps>@@ -99,7 +99,7 @@ Call `copilotkit_predict_state` **before** you start streaming the completion. IThe key is `copilotkit_predict_state({ "<state_field>": {"tool_name": ..., "tool_argument": ...} })`. Without it, the frontend would only see `document` once the tool call completed. With it, the partial argument streams onto the field while the agent is still generating.-Serve the Flow with `add_crewai_flow_fastapi_endpoint(...)` as shown in the [Frontend Overview](/en/guides/frontend/overview).+Serve the Flow with `add_crewai_flow_fastapi_endpoint(...)` as shown in the [Frontend Overview](/edge/en/guides/frontend/overview).</Step>@@ -130,13 +130,13 @@ The `document` field fills in progressively as the agent generates the `write_do## Related<CardGroup cols={2}>- <Card title="Shared State" icon="arrows-rotate" href="/en/guides/frontend/shared-state">+ <Card title="Shared State" icon="arrows-rotate" href="/edge/en/guides/frontend/shared-state">Read and write the agent's state two-way.</Card>- <Card title="Agentic Generative UI" icon="list-check" href="/en/guides/frontend/agentic-generative-ui">+ <Card title="Agentic Generative UI" icon="list-check" href="/edge/en/guides/frontend/agentic-generative-ui">Render live agent state as it changes.</Card>- <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/en/guides/frontend/tool-based-generative-ui">+ <Card title="Tool-Based Generative UI" icon="puzzle-piece" href="/edge/en/guides/frontend/tool-based-generative-ui">Map agent tool calls to components.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/reasoning.mdx b/docs/edge/en/guides/frontend/reasoning.mdxindex 104c37e94..a9a188f3b 100644--- a/docs/edge/en/guides/frontend/reasoning.mdx+++ b/docs/edge/en/guides/frontend/reasoning.mdx@@ -7,7 +7,7 @@ mode: "wide"## Thinking, rendered for free-When a reasoning-capable model thinks before it answers, CopilotKit renders that thinking right in the chat. This is the simplest generative-UI pattern in the whole section: there is nothing to build. No hook, no component, no props. Use a reasoning-capable model, keep the streaming wrapper your Flows already have, and the chat surface from the [Overview](/en/guides/frontend/overview) does the rest.+When a reasoning-capable model thinks before it answers, CopilotKit renders that thinking right in the chat. This is the simplest generative-UI pattern in the whole section: there is nothing to build. No hook, no component, no props. Use a reasoning-capable model, keep the streaming wrapper your Flows already have, and the chat surface from the [Overview](/edge/en/guides/frontend/overview) does the rest.## Use a reasoning-capable model@@ -56,13 +56,13 @@ There is no `useReasoning` hook and no reasoning component to write. Reasoning i## Related<CardGroup cols={2}>- <Card title="Generative UI" icon="wand-magic-sparkles" href="/en/guides/frontend/generative-ui">+ <Card title="Generative UI" icon="wand-magic-sparkles" href="/edge/en/guides/frontend/generative-ui">The full spectrum, from author-controlled to agent-invented UI.</Card>- <Card title="Agentic Generative UI" icon="list-check" href="/en/guides/frontend/agentic-generative-ui">+ <Card title="Agentic Generative UI" icon="list-check" href="/edge/en/guides/frontend/agentic-generative-ui">Render live agent state as the Flow works.</Card>- <Card title="Frontend Overview" icon="browser" href="/en/guides/frontend/overview">+ <Card title="Frontend Overview" icon="browser" href="/edge/en/guides/frontend/overview">Set up the chat surface and runtime.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/shared-state.mdx b/docs/edge/en/guides/frontend/shared-state.mdxindex c42fac2cf..22db30319 100644--- a/docs/edge/en/guides/frontend/shared-state.mdx+++ b/docs/edge/en/guides/frontend/shared-state.mdx@@ -115,13 +115,13 @@ class SharedStateFlow(Flow[AgentState]):pass```-Two things make this shared rather than one-way: dumping `self.state` into the prompt means the agent always works from the latest recipe (including edits the user made in the UI), and assigning `self.state.recipe` puts the new value into the state snapshot sent to connected clients at the end of the step. For updates during a long step, emit explicitly with `copilotkit_emit_state` (see [Agentic Generative UI](/en/guides/frontend/agentic-generative-ui)).+Two things make this shared rather than one-way: dumping `self.state` into the prompt means the agent always works from the latest recipe (including edits the user made in the UI), and assigning `self.state.recipe` puts the new value into the state snapshot sent to connected clients at the end of the step. For updates during a long step, emit explicitly with `copilotkit_emit_state` (see [Agentic Generative UI](/edge/en/guides/frontend/agentic-generative-ui)).</Step><Step title="Serve the Flow over AG-UI">-Expose the Flow from your FastAPI app with `add_crewai_flow_fastapi_endpoint`, then register it in the CopilotKit runtime. See the [Frontend Overview](/en/guides/frontend/overview) for the full server and runtime setup.+Expose the Flow from your FastAPI app with `add_crewai_flow_fastapi_endpoint`, then register it in the CopilotKit runtime. See the [Frontend Overview](/edge/en/guides/frontend/overview) for the full server and runtime setup.```python# server.py@@ -198,13 +198,13 @@ Putting the pieces together, a single recipe object is kept in sync in both dire## Related<CardGroup cols={2}>- <Card title="Agentic Generative UI" icon="list-check" href="/en/guides/frontend/agentic-generative-ui">+ <Card title="Agentic Generative UI" icon="list-check" href="/edge/en/guides/frontend/agentic-generative-ui">Render live agent state as it changes.</Card>- <Card title="Predictive State" icon="gauge-high" href="/en/guides/frontend/predictive-state-updates">+ <Card title="Predictive State" icon="gauge-high" href="/edge/en/guides/frontend/predictive-state-updates">Stream in-progress state to the UI as the agent works.</Card>- <Card title="Human-in-the-Loop" icon="user-check" href="/en/guides/frontend/human-in-the-loop">+ <Card title="Human-in-the-Loop" icon="user-check" href="/edge/en/guides/frontend/human-in-the-loop">Pause the agent to collect user approval or input mid-run.</Card></CardGroup>diff --git a/docs/edge/en/guides/frontend/tool-based-generative-ui.mdx b/docs/edge/en/guides/frontend/tool-based-generative-ui.mdxindex 2ef4e63d2..a9ce2497a 100644--- a/docs/edge/en/guides/frontend/tool-based-generative-ui.mdx+++ b/docs/edge/en/guides/frontend/tool-based-generative-ui.mdx@@ -11,7 +11,7 @@ When your Crew or Flow calls a tool, you rarely want the raw arguments dumped inBecause CopilotKit streams the tool call to the frontend as the model generates it, the arguments fill in progressively. Your component can paint the moment the first field arrives and update as the rest stream in.-This guide builds a haiku generator: the agent calls a `generate_haiku` tool, and the frontend renders each haiku as a card. It assumes you already have a Crew or Flow talking to a Next.js app. If not, start with the [Frontend Overview](/en/guides/frontend/overview) for the full server, runtime, and provider setup.+This guide builds a haiku generator: the agent calls a `generate_haiku` tool, and the frontend renders each haiku as a card. It assumes you already have a Crew or Flow talking to a Next.js app. If not, start with the [Frontend Overview](/edge/en/guides/frontend/overview) for the full server, runtime, and provider setup.<Note>Tool rendering works with both Crews and Flows. The example below uses a Flow, but the frontend wiring is identical either way.@@ -108,7 +108,7 @@ add_crewai_flow_fastapi_endpoint()```-Register the agent with the CopilotKit runtime and point `<CopilotKit>` at it exactly as shown in the [Frontend Overview](/en/guides/frontend/overview). The rest of this guide assumes the agent is registered under the id `haiku`.+Register the agent with the CopilotKit runtime and point `<CopilotKit>` at it exactly as shown in the [Frontend Overview](/edge/en/guides/frontend/overview). The rest of this guide assumes the agent is registered under the id `haiku`.</Step>@@ -117,7 +117,7 @@ Register the agent with the CopilotKit runtime and point `<CopilotKit>` at it exOn the frontend, call `useRenderTool` with the same `name` the backend declared. `useRenderTool` is the hook for *rendering* a tool call: it takes a `render` function and nothing to execute, because this tool is pure display.<Note>-Use `useRenderTool` when the tool only draws UI. If the tool also needs to *run* something in the browser, use [`useFrontendTool`](/en/guides/frontend/frontend-actions) instead, which pairs a `handler` with an optional `render`.+Use `useRenderTool` when the tool only draws UI. If the tool also needs to *run* something in the browser, use [`useFrontendTool`](/edge/en/guides/frontend/frontend-actions) instead, which pairs a `handler` with an optional `render`.</Note>```tsx@@ -223,13 +223,13 @@ A backend tool must return a **JSON string**, not a Python dict. The bridge stri## Related<CardGroup cols={2}>- <Card title="Agentic Generative UI" icon="list-check" href="/en/guides/frontend/agentic-generative-ui">+ <Card title="Agentic Generative UI" icon="list-check" href="/edge/en/guides/frontend/agentic-generative-ui">Render live agent state as it changes across a multi-step run.</Card>- <Card title="Human-in-the-Loop" icon="user-check" href="/en/guides/frontend/human-in-the-loop">+ <Card title="Human-in-the-Loop" icon="user-check" href="/edge/en/guides/frontend/human-in-the-loop">Pause the agent to collect user approval or input mid-run.</Card>- <Card title="Frontend Actions" icon="bolt" href="/en/guides/frontend/frontend-actions">+ <Card title="Frontend Actions" icon="bolt" href="/edge/en/guides/frontend/frontend-actions">Let the agent call functions that run in the browser.</Card></CardGroup>diff --git a/docs/edge/en/telemetry.mdx b/docs/edge/en/telemetry.mdxindex f63c5651b..0a6a285d9 100644--- a/docs/edge/en/telemetry.mdx+++ b/docs/edge/en/telemetry.mdx@@ -61,7 +61,7 @@ own tracer provider, which is independent of the one described here.| Yes | LLM Attributes | Includes: name, model_name, model, top_k, temperature, and class name of the LLM. All technical, non-personal data. || Yes | Crew Deployment attempt using crewAI CLI | Includes: The fact a deploy is being made and crew id, whether it's trying to pull logs, and whether the deploy was started from a CLI command or from the run TUI. No project or crew contents. No personal data. || Yes | Execution Environment | Includes: which AI coding assistant is running the process, if any (one of a fixed list such as `claude_code`, `codex`, `cursor`, or `unknown`), where the process runs (one of a fixed list such as `ci`, `container`, `serverless`, `interactive`), and the `project_id` from your `pyproject.toml` when one is configured. Detection reads only whether known environment variables are set, never their values. No personal data. |-| Yes | Flow Lifecycle Signals | Includes: that a flow started, whether it completed or failed, whether one of its methods failed, whether it paused for human input or feedback, whether the start was a resumed run, whether a conversation turn failed, how long the flow ran, and whether the flow is one CrewAI runs internally or one you wrote. The flow name is recorded (should not include personal info), as it already is for flow creation and execution. Method names, error messages and flow state are never recorded. No personal data. |+| Yes | Flow Lifecycle Signals | Includes: that a flow started, whether it completed or failed, whether one of its methods failed, whether it paused for human input or feedback, whether the start was a resumed run, whether a conversation turn failed, how long the flow ran, and whether the flow is one CrewAI runs internally or one you wrote. The flow name is recorded, as it already is for flow creation and execution. When a flow or one of its methods fails, the **class name** of the exception is recorded (for example `TimeoutError`) so that failures can be diagnosed — never the error message, which can contain prompts, model output, file paths or credentials. Method names and flow state are never recorded. No personal data. || Yes | Trace Sharing Signal | Includes: that a batch of traces was successfully shared with CrewAI AMP, and whether it was shared anonymously (before you have an account) or linked to your account. Like every span, it also carries the Execution Environment attributes described above (`project_id` when configured, the coding assistant, and the runtime). This row describes sharing telemetry only — not the trace contents or access granted by shared trace links. Trace contents, inputs, and outputs are never recorded on this signal. Before sharing traces, review secrets, personal data, and AMP redaction and retention settings. || No | Agent's Expanded Data | Includes: goal description, backstory text, i18n prompt file identifier. Users should ensure no personal info is included in text fields. || No | Detailed Task Information | Includes: task description, expected output description, context references. Users should ensure no personal info is included in these fields. |diff --git a/docs/edge/ko/telemetry.mdx b/docs/edge/ko/telemetry.mdxindex f1131c6b6..051c2b299 100644--- a/docs/edge/ko/telemetry.mdx+++ b/docs/edge/ko/telemetry.mdx@@ -59,7 +59,7 @@ provider로 등록하지 않습니다. 이를 통해 양방향이 분리됩니| 예 | LLM 속성 | LLM의 이름, model_name, 모델, top_k, temperature 및 클래스명이 포함됩니다. 모두 기술적이고 비개인 정보입니다. || 예 | crewAI CLI를 통한 Crew 배포 시도 | 포함 항목: 배포가 시도되고 있다는 사실과 crew id, 로그를 가져오려고 하는지 여부, 그리고 배포가 CLI 명령에서 시작되었는지 실행 TUI에서 시작되었는지 여부. 프로젝트나 crew의 내용은 기록되지 않습니다. 개인 정보 없음. || 예 | 실행 환경 | 포함: 프로세스를 실행 중인 AI 코딩 어시스턴트(있는 경우, `claude_code`, `codex`, `cursor`, `unknown` 등 고정 목록 중 하나), 프로세스가 실행되는 위치(`ci`, `container`, `serverless`, `interactive` 등 고정 목록 중 하나), 그리고 `pyproject.toml`에 설정된 경우 `project_id`. 감지는 알려진 환경 변수의 설정 여부만 확인하며 값은 읽지 않음. 개인 데이터 없음. |-| 예 | Flow 라이프사이클 신호 | 포함 항목: flow의 시작, 완료 또는 실패 여부, 해당 메서드의 실패 여부, 사람의 입력이나 피드백을 위해 일시 중지되었는지 여부, 해당 시작이 재개된 실행인지 여부, 대화 턴의 실패 여부, flow 실행 시간, 그리고 해당 flow가 CrewAI가 내부적으로 실행하는 것인지 사용자가 작성한 것인지 여부. flow 이름은 기록되며(개인 정보를 포함해서는 안 됨), 이는 flow 생성 및 실행에서 이미 그러합니다. 메서드 이름, 오류 메시지, flow 상태는 절대 기록하지 않습니다. 개인 정보 없음. |+| 예 | Flow 라이프사이클 신호 | 포함 항목: flow의 시작, 완료 또는 실패 여부, 해당 메서드의 실패 여부, 사람의 입력이나 피드백을 위해 일시 중지되었는지 여부, 해당 시작이 재개된 실행이었는지 여부, 대화 턴의 실패 여부, flow 실행 시간, 그리고 해당 flow가 CrewAI가 내부적으로 실행하는 것인지 사용자가 작성한 것인지 여부. flow 이름은 flow 생성 및 실행에서와 마찬가지로 기록됩니다. flow 또는 해당 메서드가 실패하면 장애 진단을 위해 예외의 **클래스 이름**(예: `TimeoutError`)이 기록되며, 프롬프트·모델 출력·파일 경로·자격 증명이 포함될 수 있는 오류 메시지는 절대 기록되지 않습니다. 메서드 이름과 flow 상태는 절대 기록되지 않습니다. 개인 정보 없음. || 예 | 트레이스 공유 신호 | 포함 항목: 트레이스 배치가 CrewAI AMP에 성공적으로 공유되었는지 여부와, 익명으로(계정 생성 전) 공유되었는지 또는 계정에 연결되어 공유되었는지 여부. 모든 span과 마찬가지로 위에서 설명한 실행 환경 속성(구성된 경우 `project_id`, 코딩 어시스턴트, 런타임)도 함께 기록됩니다. 이 행은 공유 텔레메트리만 설명하며 — 트레이스 내용이나 공유된 트레이스 링크로 부여되는 접근 권한은 설명하지 않습니다. 트레이스 내용, 입력, 출력은 이 신호에는 기록되지 않습니다. 트레이스를 공유하기 전에 비밀 정보, 개인 데이터, AMP 편집 및 보존 설정을 검토하세요. || 아니오 | 에이전트 확장 데이터 | 목표 설명, 배경 이야기 텍스트, i18n 프롬프트 파일 식별자가 포함됩니다. 사용자들은 텍스트 필드에 개인 정보가 포함되지 않도록 해야 합니다. || 아니오 | 상세 작업 정보 | 작업 설명, 예상 출력 설명, 컨텍스트 참조가 포함됩니다. 사용자들은 이러한 필드에 개인 정보가 포함되지 않도록 해야 합니다. |diff --git a/docs/edge/pt-BR/telemetry.mdx b/docs/edge/pt-BR/telemetry.mdxindex c7156e20a..ee3335503 100644--- a/docs/edge/pt-BR/telemetry.mdx+++ b/docs/edge/pt-BR/telemetry.mdx@@ -61,7 +61,7 @@ por meio do próprio tracer provider, que é independente do descrito aqui.| Sim | Atributos do LLM | Inclui: nome, model_name, model, top_k, temperatura e nome da classe do LLM. Todos técnicos, sem dados pessoais. || Sim | Tentativa de Deploy do Crew pelo CLI do crewAI | Inclui: O fato de um deploy estar sendo realizado e o crew id, se está tentando buscar logs, e se o deploy foi iniciado por um comando do CLI ou pela TUI de execução. Não inclui conteúdo do projeto ou do crew nem dados pessoais. || Sim | Ambiente de Execução | Inclui: qual assistente de código com IA está executando o processo, se houver (um de uma lista fixa como `claude_code`, `codex`, `cursor` ou `unknown`), onde o processo é executado (um de uma lista fixa como `ci`, `container`, `serverless`, `interactive`) e o `project_id` do seu `pyproject.toml` quando houver um configurado. A detecção lê apenas se variáveis de ambiente conhecidas estão definidas, nunca seus valores. Sem dados pessoais. |-| Sim | Sinais de Ciclo de Vida do Flow | Inclui: que um flow iniciou, se foi concluído ou falhou, se um de seus métodos falhou, se pausou para entrada ou feedback humano, se o início foi uma execução retomada, se um turno de conversa falhou, por quanto tempo o flow executou e se o flow é um que o CrewAI executa internamente ou um que você escreveu. O nome do flow é registrado (não deve incluir informações pessoais), como já ocorre na criação e execução do flow. Nomes de métodos, mensagens de erro e estado do flow nunca são registrados. Sem dados pessoais. |+| Sim | Sinais de Ciclo de Vida do Flow | Inclui: que um flow iniciou, se foi concluído ou falhou, se um de seus métodos falhou, se pausou para entrada ou feedback humano, se o início foi uma execução retomada, se um turno de conversa falhou, quanto tempo o flow executou, e se o flow é um que a CrewAI executa internamente ou um que você escreveu. O nome do flow é registrado, como já é para criação e execução de flow. Quando um flow ou um de seus métodos falha, o **nome da classe** da exceção é registrado (por exemplo `TimeoutError`) para permitir o diagnóstico de falhas — nunca a mensagem de erro, que pode conter prompts, saída do modelo, caminhos de arquivo ou credenciais. Nomes de métodos e estado do flow nunca são registrados. Nenhum dado pessoal. || Sim | Sinal de Compartilhamento de Trace | Inclui: que um lote de traces foi compartilhado com sucesso com o CrewAI AMP, e se foi compartilhado anonimamente (antes de você ter uma conta) ou vinculado à sua conta. Como todo span, também carrega os atributos de Ambiente de Execução descritos acima (`project_id` quando configurado, o assistente de programação e o runtime). Esta linha descreve apenas a telemetria do compartilhamento — não o conteúdo dos traces nem o acesso concedido por links de traces compartilhados. O conteúdo dos traces, entradas e saídas nunca são registrados neste sinal. Antes de compartilhar traces, revise segredos, dados pessoais e as configurações de redação e retenção do AMP. || Não | Dados Expandidos do Agente | Inclui: descrição do objetivo, texto da história, identificador de arquivo i18n prompt. Usuários devem garantir que não haja info pessoal nesses campos de texto. || Não | Informações Detalhadas da Tarefa | Inclui: descrição da tarefa, descrição do resultado esperado, referências de contexto. Usuários devem garantir que não haja info pessoal nessas áreas. |diff --git a/lib/crewai/src/crewai/events/event_listener.py b/lib/crewai/src/crewai/events/event_listener.pyindex 4182c5f04..8146fc58b 100644--- a/lib/crewai/src/crewai/events/event_listener.py+++ b/lib/crewai/src/crewai/events/event_listener.py@@ -339,7 +339,12 @@ class EventListener(BaseEventListener):else "user")- def _report_flow_duration(source: Any, flow_name: str, outcome: str) -> None:+ def _report_flow_duration(+ source: Any,+ flow_name: str,+ outcome: str,+ error_type: type[BaseException] | None = None,+ ) -> None:"""Emit the elapsed time for a flow that reached a terminal state.A flow can finish without this listener having seen it start - a@@ -348,7 +353,7 @@ class EventListener(BaseEventListener):"""# Reset point for the flag a deferred session accumulates across# turns, so a later session on this instance starts clean.- source._telemetry_turn_failed = False+ source._telemetry_turn_error = Nonestarted_at = getattr(source, "_telemetry_started_at", None)if started_at is None:return@@ -359,6 +364,7 @@ class EventListener(BaseEventListener):outcome,_flow_origin(source),_is_conversational(source),+ error_type=error_type,)@crewai_event_bus.on(FlowStartedEvent)@@ -382,12 +388,12 @@ class EventListener(BaseEventListener):@crewai_event_bus.on(FlowFinishedEvent)def on_flow_finished(source: Any, event: FlowFinishedEvent) -> None:- outcome = (- "failed"- if getattr(source, "_telemetry_turn_failed", False)- else "completed"- )- _report_flow_duration(source, event.flow_name, outcome)+ # A deferred session closes here whatever happened, so the class+ # stored by on_conversation_turn_failed is the only record of what+ # went wrong - FlowFailedEvent never fires on that path.+ turn_error = getattr(source, "_telemetry_turn_error", None)+ outcome = "failed" if turn_error is not None else "completed"+ _report_flow_duration(source, event.flow_name, outcome, turn_error)if not getattr(source, "suppress_flow_events", False):self.formatter.handle_flow_status(@@ -397,7 +403,9 @@ class EventListener(BaseEventListener):@crewai_event_bus.on(FlowFailedEvent)def on_flow_failed(source: Any, event: FlowFailedEvent) -> None:- _report_flow_duration(source, event.flow_name, "failed")+ # Class name only. The message is never read - it routinely carries+ # prompts, model output and credentials.+ _report_flow_duration(source, event.flow_name, "failed", type(event.error))if not getattr(source, "suppress_flow_events", False):self.formatter.handle_flow_status(@@ -423,7 +431,7 @@ class EventListener(BaseEventListener):# handle_turn emits this one - it cleared the stamp, and flagging# now would mark the next turn on this instance failed.if getattr(source, "_telemetry_started_at", None) is not None:- source._telemetry_turn_failed = True+ source._telemetry_turn_error = type(event.error)@crewai_event_bus.on(FlowInputRequestedEvent)def on_flow_input_requested(_: Any, event: FlowInputRequestedEvent) -> None:@@ -460,9 +468,12 @@ class EventListener(BaseEventListener):source: Any, event: MethodExecutionFailedEvent) -> None:# The method name is not recorded: it is user-authored and would put- # arbitrary strings in telemetry.+ # arbitrary strings in telemetry. The exception class name is, so a+ # failure is diagnosable; the message never is.self._telemetry.flow_method_failed_span(- event.flow_name, _flow_origin(source)+ event.flow_name,+ _flow_origin(source),+ error_type=type(event.error),)self.formatter.handle_method_status(diff --git a/lib/crewai/src/crewai/flow/runtime/__init__.py b/lib/crewai/src/crewai/flow/runtime/__init__.pyindex 30d5fbe19..875db3800 100644--- a/lib/crewai/src/crewai/flow/runtime/__init__.py+++ b/lib/crewai/src/crewai/flow/runtime/__init__.py@@ -727,7 +727,7 @@ class Flow(BaseModel, Generic[T], metaclass=FlowMeta):# conversational session emits FlowFinishedEvent from# finalize_session_traces() regardless of outcome, so without this a failed# session would be reported as a successful completion.- _telemetry_turn_failed: bool = PrivateAttr(default=False)+ _telemetry_turn_error: type[BaseException] | None = PrivateAttr(default=None)_is_execution_resuming: bool = PrivateAttr(default=False)_restored_from_checkpoint: bool = PrivateAttr(default=False)diff --git a/lib/crewai/src/crewai/telemetry/telemetry.py b/lib/crewai/src/crewai/telemetry/telemetry.pyindex 19fedb346..cd60505b2 100644--- a/lib/crewai/src/crewai/telemetry/telemetry.py+++ b/lib/crewai/src/crewai/telemetry/telemetry.py@@ -1042,6 +1042,28 @@ class Telemetry:self._safe_telemetry_operation(_operation)+ @staticmethod+ def _safe_error_type(error_type: type[BaseException] | None) -> str | None:+ """The exception's class name, or None if the argument is not one.++ Takes the exception *class* rather than a string so that ``str(error)``+ cannot be passed at all: a message is never a type. Accepting a string+ and filtering it with ``isidentifier()`` would not be enough, because a+ single-word message such as ``"secret_token"`` is itself a valid+ identifier. The identifier check is kept as a second gate on the+ derived name.++ Only a class name is ever recorded - never the message, which routinely+ carries prompts, model output, file paths and credentials.+ """+ if (+ isinstance(error_type, type)+ and issubclass(error_type, BaseException)+ and error_type.__name__.isidentifier()+ ):+ return error_type.__name__+ return None+def flow_completed_span(self,flow_name: str,@@ -1049,6 +1071,7 @@ class Telemetry:outcome: str,origin: str = "user",conversational: bool = False,+ error_type: type[BaseException] | None = None,) -> None:"""Records how long a flow ran and how it ended.@@ -1071,7 +1094,11 @@ class Telemetry:executor), ``"user"`` for flows the caller authored.conversational: True when this closes a conversational session. Oneof these answers many ``Flow Execution`` spans, one per turn.+ error_type: Class of the exception that ended the run, for a+ failed outcome. Only its name is recorded. See+ :meth:`_safe_error_type`."""+ safe_error_type = self._safe_error_type(error_type)def _operation() -> None:tracer = self.provider.get_tracer(TRACER_NAME)@@ -1084,6 +1111,8 @@ class Telemetry:self._add_attribute(span, "conversational", "true" if conversational else "false")+ if safe_error_type:+ self._add_attribute(span, "error_type", safe_error_type)close_span(span)self._safe_telemetry_operation(_operation)@@ -1111,17 +1140,27 @@ class Telemetry:self._safe_telemetry_operation(_operation)- def flow_method_failed_span(self, flow_name: str, origin: str = "user") -> None:+ def flow_method_failed_span(+ self,+ flow_name: str,+ origin: str = "user",+ error_type: type[BaseException] | None = None,+ ) -> None:"""Records that a method inside a flow raised.The method name is deliberately not recorded: it is user-authored and- would put arbitrary strings in telemetry.+ would put arbitrary strings in telemetry. The exception's class name is+ recorded, because knowing *what* fails is the whole point of the span+ and a class name is a bare identifier, not free text.Args:flow_name: Name of the flow whose method failed.origin: ``"internal"`` or ``"user"`` - see:meth:`flow_execution_span`.+ error_type: Class of the exception raised. Only its name is+ recorded. See :meth:`_safe_error_type`."""+ safe_error_type = self._safe_error_type(error_type)def _operation() -> None:tracer = self.provider.get_tracer(TRACER_NAME)@@ -1129,6 +1168,8 @@ class Telemetry:self._add_attribute(span, "crewai_version", version("crewai"))self._add_attribute(span, "flow_name", flow_name)self._add_attribute(span, "origin", origin)+ if safe_error_type:+ self._add_attribute(span, "error_type", safe_error_type)close_span(span)self._safe_telemetry_operation(_operation)diff --git a/lib/crewai/tests/telemetry/test_flow_telemetry.py b/lib/crewai/tests/telemetry/test_flow_telemetry.pyindex 81fbd03a1..0fdbe6cd3 100644--- a/lib/crewai/tests/telemetry/test_flow_telemetry.py+++ b/lib/crewai/tests/telemetry/test_flow_telemetry.py@@ -118,34 +118,45 @@ def pauses(monkeypatch: pytest.MonkeyPatch) -> list[tuple[str, str]]:@pytest.fixture-def method_failures(monkeypatch: pytest.MonkeyPatch) -> list[tuple[str, str]]:- """Record (flow_name, origin) for every Flow Method Failed span."""+def method_failures(+ monkeypatch: pytest.MonkeyPatch,+) -> list[tuple[str, str, str | None]]:+ """Record (flow_name, origin, error_type) for every Flow Method Failed span."""from crewai.events import event_listener as listener_module_reregister_listener()- recorded: list[tuple[str, str]] = []+ recorded: list[tuple[str, str, str | None]] = []monkeypatch.setattr(listener_module.event_listener._telemetry,"flow_method_failed_span",- lambda flow_name, origin="user": recorded.append((flow_name, origin)),+ lambda flow_name, origin="user", error_type=None: recorded.append(+ (flow_name, origin, getattr(error_type, "__name__", None))+ ),)return recorded@pytest.fixture-def durations(monkeypatch: pytest.MonkeyPatch) -> list[tuple[str, float, str]]:- """Record every (flow_name, duration_ms, outcome) the listener reports."""+def durations(+ monkeypatch: pytest.MonkeyPatch,+) -> list[tuple[str, float, str, str | None]]:+ """Record every (flow_name, duration_ms, outcome, error_type) reported."""from crewai.events import event_listener as listener_module_reregister_listener()- recorded: list[tuple[str, float, str]] = []+ recorded: list[tuple[str, float, str, str | None]] = []monkeypatch.setattr(listener_module.event_listener._telemetry,"flow_completed_span",- lambda flow_name, duration_ms, outcome, origin="user", conversational=False: recorded.append(- (flow_name, duration_ms, outcome)+ lambda flow_name,+ duration_ms,+ outcome,+ origin="user",+ conversational=False,+ error_type=None: recorded.append(+ (flow_name, duration_ms, outcome, getattr(error_type, "__name__", None))),)return recorded@@ -175,7 +186,7 @@ def features(monkeypatch: pytest.MonkeyPatch) -> list[str]:def test_completed_flow_reports_its_outcome(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""Outcome is a lifecycle fact, so it belongs on a span, not a feature."""@@ -186,11 +197,11 @@ def test_completed_flow_reports_its_outcome(OkFlow().kickoff()- assert [(n, o) for n, _d, o in durations] == [("OkFlow", "completed")]+ assert [(n, o) for n, _d, o, _e in durations] == [("OkFlow", "completed")]def test_failed_flow_reports_the_failure_and_the_method(- durations: list[tuple[str, float, str]], method_failures: list[tuple[str, str]]+ durations: list[tuple[str, float, str, str | None]], method_failures: list[tuple[str, str, str | None]]) -> None:class BoomFlow(Flow):@start()@@ -200,8 +211,10 @@ def test_failed_flow_reports_the_failure_and_the_method(with pytest.raises(RuntimeError, match="boom"):BoomFlow().kickoff()- assert [(n, o) for n, _d, o in durations] == [("BoomFlow", "failed")]- assert ("BoomFlow", "user") in method_failures+ assert [(n, o, e) for n, _d, o, e in durations] == [+ ("BoomFlow", "failed", "RuntimeError")+ ]+ assert ("BoomFlow", "user", "RuntimeError") in method_failuresdef test_a_failed_flow_is_still_counted_as_an_execution(@@ -305,8 +318,8 @@ def test_failed_conversation_turn_is_reported(features: list[str]) -> None:def test_no_method_names_or_error_text_are_recorded(- method_failures: list[tuple[str, str]],- durations: list[tuple[str, float, str]],+ method_failures: list[tuple[str, str, str | None]],+ durations: list[tuple[str, float, str, str | None]],features: list[str],) -> None:"""Method names and error text are user-authored and must not be sent.@@ -333,9 +346,41 @@ def test_no_method_names_or_error_text_are_recorded(assert "my_secret_method_name" not in valueassert "secret error detail" not in value+ # The contract is type-yes, message-no: the class name is what makes a+ # failure diagnosable, and it is the only part of the exception recorded.+ assert method_failures[0][2] == "RuntimeError"+ assert durations[0][3] == "RuntimeError"+++def test_error_type_only_accepts_an_exception_class() -> None:+ """A message can never be recorded, because a message is not a class.++ Filtering a string with isidentifier() would not be enough: a single-word+ message such as "secret_token" is itself a valid identifier. Taking the+ class removes the possibility rather than filtering for it.+ """+ from crewai.telemetry.telemetry import Telemetry++ class AuthenticationError(Exception):+ pass++ assert Telemetry._safe_error_type(RuntimeError) == "RuntimeError"+ assert Telemetry._safe_error_type(AuthenticationError) == "AuthenticationError"++ for not_a_class in (+ "secret_token", # identifier-form message: the regression this pins+ "RuntimeError", # even the correct name, as a string, is refused+ "secret error detail",+ "Invalid API key sk-abc123",+ RuntimeError("boom"), # an instance is not the class+ None,+ 42,+ ):+ assert Telemetry._safe_error_type(not_a_class) is None+def test_completed_flow_reports_a_real_duration(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""Elapsed time must be measured, not merely present."""@@ -348,14 +393,14 @@ def test_completed_flow_reports_a_real_duration(SlowFlow().kickoff()assert len(durations) == 1- flow_name, duration_ms, outcome = durations[0]+ flow_name, duration_ms, outcome, _error_type = durations[0]assert flow_name == "SlowFlow"assert outcome == "completed"assert duration_ms >= 50def test_failed_flow_reports_its_duration_and_outcome(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:class SlowBoomFlow(Flow):@start()@@ -367,14 +412,14 @@ def test_failed_flow_reports_its_duration_and_outcome(SlowBoomFlow().kickoff()assert len(durations) == 1- flow_name, duration_ms, outcome = durations[0]+ flow_name, duration_ms, outcome, _error_type = durations[0]assert flow_name == "SlowBoomFlow"assert outcome == "failed"assert duration_ms >= 50def test_no_duration_is_reported_without_a_recorded_start(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""A completion with no observed start reports nothing, and does not raise.@@ -399,7 +444,7 @@ def test_no_duration_is_reported_without_a_recorded_start(def test_duration_is_reported_once_per_run(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""The stamp is cleared on use, so a repeated completion cannot double-count."""from crewai.events.event_bus import crewai_event_bus@@ -467,7 +512,7 @@ def test_resumed_flow_is_reported(tmp_path,pauses: list[tuple[str, str]],starts: list[tuple[str, bool]],- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""A restored run is only visible here - there is no resume event.@@ -515,11 +560,11 @@ def test_resumed_flow_is_reported(flow.resume("looks good")assert ("ReviewFlow", True) in starts- assert ("ReviewFlow", "completed") in [(n, o) for n, _d, o in durations]+ assert ("ReviewFlow", "completed") in [(n, o) for n, _d, o, _e in durations]def test_a_user_flow_that_suppresses_console_events_still_reports(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""``suppress_flow_events`` asks for console quiet, not for no telemetry."""@@ -532,7 +577,7 @@ def test_a_user_flow_that_suppresses_console_events_still_reports(QuietFlow().kickoff()- assert [(n, o) for n, _d, o in durations] == [("QuietFlow", "completed")]+ assert [(n, o) for n, _d, o, _e in durations] == [("QuietFlow", "completed")]def test_a_declarative_flow_is_not_treated_as_internal(@@ -549,7 +594,7 @@ def test_a_declarative_flow_is_not_treated_as_internal(def test_a_failed_conversation_session_is_not_reported_completed(- features: list[str], durations: list[tuple[str, float, str]]+ features: list[str], durations: list[tuple[str, float, str, str | None]]) -> None:"""A conversational session closes with FlowFinishedEvent either way.@@ -570,11 +615,11 @@ def test_a_failed_conversation_session_is_not_reported_completed(chat.finalize_session_traces()assert "flow:conversation_turn_failed" in features- assert all(outcome != "completed" for _n, _d, outcome in durations)+ assert all(outcome != "completed" for _n, _d, outcome, _e in durations)def test_a_deferred_session_still_reports_a_failed_turn(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""A deferring session has no per-turn terminal event to carry the failure.@@ -597,11 +642,15 @@ def test_a_deferred_session_still_reports_a_failed_turn(# finalize_session_traces() emits without awaiting its handlers.wait_for_event_handlers()- assert [outcome for _n, _d, outcome in durations] == ["failed"]+ # FlowFailedEvent never fires on this path, so the class stored by+ # on_conversation_turn_failed is the only record of what went wrong.+ assert [(outcome, e) for _n, _d, outcome, e in durations] == [+ ("failed", "RuntimeError")+ ]def test_a_failed_turn_does_not_mark_the_next_turn_failed(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""A session that opts out of deferral ends each turn with its own event.@@ -628,11 +677,11 @@ def test_a_failed_turn_does_not_mark_the_next_turn_failed(chat.handle_turn("hello")chat.handle_turn("again")- assert [outcome for _n, _d, outcome in durations] == ["failed", "completed"]+ assert [outcome for _n, _d, outcome, _e in durations] == ["failed", "completed"]def test_a_failed_streamed_turn_does_not_mark_the_next_turn_failed(- durations: list[tuple[str, float, str]],+ durations: list[tuple[str, float, str, str | None]],) -> None:"""``stream_turn`` is the other emitter of the turn-failure event.@@ -658,11 +707,11 @@ def test_a_failed_streamed_turn_does_not_mark_the_next_turn_failed(list(chat.stream_turn("hello").events)list(chat.stream_turn("again").events)- assert [outcome for _n, _d, outcome in durations] == ["failed", "completed"]+ assert [outcome for _n, _d, outcome, _e in durations] == ["failed", "completed"]def test_infrastructure_flows_do_not_pollute_outcome_signals(- features: list[str], durations: list[tuple[str, float, str]]+ features: list[str], durations: list[tuple[str, float, str, str | None]]) -> None:"""CrewAI's own flows must not be counted as user flow outcomes.@@ -697,7 +746,7 @@ def test_infrastructure_flows_do_not_pollute_outcome_signals(# Internal outcomes are still recorded - on the span, tagged internal -# they simply do not masquerade as a user's flow finishing.assert ("AgentExecutor", "completed") in [- (name, outcome) for name, _duration, outcome in durations+ (name, outcome) for name, _duration, outcome, _error in durations]assert "flow:completed" not in features