Commit Graph

28 Commits

Author SHA1 Message Date
Ran Shem Tov b69ac14711 fix(showcase): keep the AG-UI request context on the chat Flow, and point the Channels setup at /chat
Review found two gaps in the previous commit.

`RunAgentInput.context` never reached the model. The bridge puts it on state
under `context`, but `CopilotKitState` does not declare the field, so pydantic
drops it when the endpoint validates the request into the Flow's state and the
"Application context" block rendered without it. That hollowed out the two cells
whose whole point is reading application context: readonly-state-agent-context
(now on the default `/chat` route) and agent-config. `ChatState` declares the
field so it survives validation.

Neither existing test caught it: the readonly probe only asserts the browser
request body carries its sentinel, the agent-config probe encodes the expected
value in the user message, and Flow-level unit tests bypass endpoint state
initialization. The new endpoint test drives the real FastAPI route with two
context entries and asserts both appear in the model's system message; it fails
without the declared field.

The Channels setup fragment still told readers the shared crew sits at the
server root and set `AGENT_URL` accordingly, which the removed catch-all turned
into a dead endpoint. It now points at `/chat` and says Flow rather than crew.
Migrating the consumer was preferred over restoring `/`, which would put the
silent-fallback trap back in place.

Verified: 164 and 166 Python tests pass across the two columns, the docs
setup-content tests pass (16), and readonly-state-agent-context, agent-config
and agentic-chat are green on D6 replay.
2026-08-21 10:52:54 +02:00
Ran Shem Tov f421ae6180 fix(showcase): serve the CrewAI Flows plain-assistant cells with a Flow, not a crew
The `crewai-crews` column is presented as "CrewAI Flows", but eleven of its
demos were served by `add_crewai_crew_fastapi_endpoint` through a root
catch-all: agentic-chat, gen-ui-tool-based, both prebuilt-chrome cells,
chat-slots, chat-customization-css, headless-simple,
readonly-state-agent-context, agent-config, auth and voice.

That helper wraps the crew in `ChatWithCrewFlow`, whose system message comes
from CrewAI's `build_system_message`. Its boilerplate is unconditional: it tells
the model to introduce itself and to steer every answer back to the crew's
purpose, illustrated with a research-report example. Since the catch-all served
the scaffold research crew, those cells answered the user and then offered to
research the latest AI developments. Measured on real OpenAI, turn two of a
plain arithmetic question came back as "12 x 12 = 144." followed by "I'm here to
help with researching the latest AI developments and producing actionable
reports."

Pre-seeding a hand-written crew description (the existing
`preseed_system_prompt`) only retargets that tail; the boilerplate around it
stays. Verified against the pre-seeded `/mcp-apps` crew, which still introduces
itself and offers a diagram.

Changes:
- Add `chat_flow.PromptedChatFlow`, a neutral one-turn Flow that owns its prompt
  and forwards frontend tools, and serve it at `/chat` via
  `add_crewai_flow_fastapi_endpoint`. The conversational column already had this
  class inline; it now imports the same module so both columns share one prompt.
- Point the runtime's default agent target plus the agent-config, auth and voice
  routes at `/chat`, and drop the root catch-all registration. An unrouted agent
  name now fails loudly instead of landing on someone else's backend.
- Give gen-ui-tool-based its own `gen_ui_tool_based` Flow, mirroring
  langgraph-python's dedicated graph: the cell must force a `render_*` chart call
  on the user's turn, which a neutral assistant does not do. Wired into the
  conversational registry too.
- Leave the remaining crew endpoints (`/mcp-apps`, `/byoc-hashbrown`,
  `/byoc-json-render`) alone; each already overrides the composed system message.
- Refresh the comments that described the removed catch-all.

Coverage: new `test_chat_flow.py` pins the prompt contract, the absence of
crew-chat boilerplate and frontend-tool forwarding; a routing contract test
asserts no cell can reach a crew endpoint by fall-through.
2026-08-20 12:35:05 +02:00
Mark f97f0768ba test(showcase): isolate CrewAI resume bridge contracts
Exercise both bridge bindings without leaking monkeypatches, and verify rejected bridge versions cannot mutate either binding.
2026-08-13 16:46:26 -07:00
Mark 2116257e1e test(showcase): harden CrewAI cancellation regressions
Use bounded dispatch and cancellation waits in both CrewAI integrations, and verify any fallback worker finishes during cleanup.
2026-08-13 16:46:14 -07:00
Mark 35aa2a34a0 fix(showcase): close CrewAI cancellation edge cases
Use AsyncOpenAI so cancellation reaches the in-flight GenerateA2UI request while retaining the thread fallback for synchronous backend tools.

Preserve cancelled versus resolved-null interrupts across pinned ag-ui-crewai 0.3.0 by encoding only resolved null as JSON null and failing loudly on version drift.

Reuse the canonical shared render_a2ui schema so the secondary request remains aligned with the shared tool contract.
2026-08-13 16:46:05 -07:00
Ran Shem Tov 48a01b6203 fix(showcase): harden CrewAI probe parity 2026-08-13 00:10:36 +02:00
Ran Shem Tov 79f56d9f8e fix(showcase): finalize CrewAI D6 on official bridge 2026-08-11 22:45:04 +03:00
Ran Shem Tov 61eed4a4ad fix(showcase): harden CrewAI D6 parity on a3 2026-08-07 17:50:13 +03:00
Ran Shem Tov 5136097aa0 feat(showcase): add CrewAI conversational flows 2026-08-06 15:33:10 +03:00
Ran Shem Tov ccf979eca8 fix(showcase): stabilize remaining CrewAI D6 cells 2026-08-05 22:38:23 +03:00
Ran Shem Tov c60233acb2 fix(showcase): close CrewAI D6 tool lifecycles 2026-08-05 19:15:33 +03:00
Ran Shem Tov 08c38950da fix(showcase): route CrewAI D6 native flows 2026-08-05 18:55:40 +03:00
Ran Shem Tov 801913c801 feat(showcase): enroll CrewAI in all 41 D6 cells 2026-08-05 18:32:31 +03:00
Ran Shem Tov 8f74bcb738 feat(showcase): add CrewAI state and multimodal flows 2026-08-05 18:22:36 +03:00
Ran Shem Tov 02c0daf28a fix(showcase): settle CrewAI interrupt resumes 2026-08-05 18:16:51 +03:00
Ran Shem Tov 1265509f37 feat(showcase): add native CrewAI Flow interrupts 2026-08-05 17:51:43 +03:00
Ran Shem Tov 7e85d964d5 feat(showcase): use native CrewAI reasoning and inputs 2026-08-05 17:35:35 +03:00
Ran Shem Tov 33aa7fed82 chore(showcase): validate CrewAI alpha stack 2026-08-05 17:26:38 +03:00
github-actions[bot] 691c036789 style: auto-fix formatting 2026-06-19 20:54:20 +00:00
Jordan Ritter 9d66761064 feat(cvdiag): backend instrumentation for pydantic-ai + crewai-crews + agno (L1-D2) 2026-06-18 14:37:10 -07:00
Jordan Ritter 2dbecf5f93 test(showcase): reasoning error-path, history, and parity coverage + forwarded-props agent stub 2026-06-10 07:11:25 -07:00
Jordan Ritter 8f8b7857e3 fix(showcase): stub agents.gen_ui_agent in forwarded-props test fixtures 2026-05-31 11:05:52 -07:00
Jordan Ritter 619be316c4 fix(showcase): stub agents._header_forwarding in crewai-crews python test
The D6 conveyance commit added a top-level _header_forwarding import in
agent_server.py; the test's _stub_heavy_modules fixture omitted it, causing
ModuleNotFoundError at import time. Register the stub submodule with a no-op
hook and a pass-through BaseHTTPMiddleware subclass.
2026-05-30 18:27:56 -07:00
Jordan Ritter 2482317ccc style: apply ruff format to Python codebase
320 files reformatted. One-time alignment to match the ruff format
check added to CI in #4812.
2026-05-13 23:10:35 -07:00
Jordan Ritter 3cd2520c5a fix(showcase): add missing module stubs in crewai-crews forwarded props tests
The _stub_agent_server_deps fixture was missing stubs for
agents.interrupt_crew and agents.tool_rendering, which were added to
agent_server.py in d6b784ee9 (interrupt demos). The missing
interrupt_crew stub caused ModuleNotFoundError on import, failing 5
tests on both Python 3.10 and 3.12 in the Showcase: Validate workflow.
2026-04-30 17:15:53 -07:00
Alem Tuzlak 7e4490eebb fix(showcase/crewai): stub mcp_apps_agent module in test_forwarded_props 2026-04-29 13:11:19 +02:00
Alem Tuzlak 23a3b24a01 feat(showcase/integrations): shared-state-read-write + subagents demos across 15 packages
Adds real working Shared State (Read+Write) and Sub-Agents demos to 15
showcase integrations, mirroring the canonical langgraph-python and
google-adk reference implementations. Fills rows previously empty on
the showcase coverage dashboard.

Packages: ag2, agno, claude-sdk-python, claude-sdk-typescript,
crewai-crews, langgraph-fastapi, langgraph-typescript, langroid,
llamaindex, mastra, ms-agent-dotnet, ms-agent-python, pydantic-ai,
spring-ai, strands. (built-in-agent landed independently on main as
PR #4321 — its variant is canonical; this PR no longer touches it.)

Per-package deliverables: framework-native backend agents
(preferences-injection middleware/callback + set_notes tool;
supervisor + 3 sub-agents wired as tools with running -> completed
/failed delegation log); frontend page.tsx + preferences-card.tsx /
notes-card.tsx for SSRW and delegation-log.tsx for subagents — wired
to useAgent({ updates: [OnStateChanged] }); manifest entries; runtime
route registration + per-package agent server config; real QA
scripts.

Includes targeted hardening fixes from a 7-agent code-review loop:

- Sub-agent failure paths now correctly emit status: "failed"
  (previously hardcoded "completed" or unreachable in
  mastra/strands/langgraph-fastapi/langgraph-typescript/ag2)
- Parallel-tool-call delegation race fixed in langgraph-fastapi
  (Annotated[list, add]) and langgraph-typescript (concat reducer)
- Silent data loss eliminated in
  claude-sdk-python/claude-sdk-typescript/crewai-crews — empty
  JSON.parse catches now log + emit error events
- ms-agent-dotnet set_notes writes to per-thread slot via AsyncLocal
- mastra working-memory writes are deterministic via
  src/mastra/tools/working-memory.ts helper
- spring-ai tool-call envelope ids match supervisor's tc.id() and
  AG-UI event ordering reordered; CopyOnWriteArrayList for
  parallel-call safety
- Stack trace + raw error message leaks scrubbed across 8+ Next.js
  routes — log server-side with errorId + return generic envelope
- Sub-agent calls no longer block event loops in ag2
  (asyncio.to_thread), langroid (llm_response_async), pydantic-ai
  (async run + async tools)
- langroid lru_cache cross-request contamination dropped
- Numerous smaller items: claude-sdk-python invalid model id, Callable
  annotation, /health endpoint exposed; crewai-crews supervisor
  no longer resets delegations every turn; pydantic-ai snapshot uses
  model_dump()

CI fixes folded in:
- crewai-crews test_forwarded_props: extend the stubbed
  ag_ui_crewai.endpoint module to expose
  add_crewai_flow_fastapi_endpoint and add stub
  agents.shared_state_read_write / agents.subagents modules
- generate-catalog test: bump crewai-crews wired-cell expectation
  28 -> 30; replace hardcoded total-wired count with an invariant
  (wired + stub + unshipped = 737) plus a lower-bound floor
- oxfmt run on the qa/shared-state-read-write.md files in mastra +
  spring-ai

Rebased onto latest main (post showcase/packages -> showcase/integrations
rename + post built-in-agent landing). Original blitz history
preserved at the blitz-pre-rebase-snapshot tag.

Known follow-ups (deferred to follow-up PR):
- agno sync sub_agent.run() blocks event loop (perf only)
- ms-agent-python asyncio thread-fallback fragility
- llamaindex initial-state coercion when UI clears state
- Manifest highlight audit (langgraph-typescript headless-complete,
  langgraph-fastapi byoc-* missing route.ts highlights)
- agno hitl-in-chat declared in demos but not features; duplicate
  /demos/hitl-in-chat route
- langgraph-typescript server.mjs graphSpec only registers 3 graphs
  vs 23 in langgraph.json (pre-existing)
- mastra hitl legacy demo missing from features list
- claude-sdk-python agents/agent.py line 474 also has the legacy
  claude-opus-4-5 default
- PARITY_NOTES vs manifest mismatches for hitl-in-app across
  spring-ai/agno/ag2 (pre-existing)
- spring-ai a2ui-fixed-schema missing from generative_ui list
2026-04-28 18:36:13 +02:00
Jordan Ritter dd06dd89d1 refactor(showcase): rename packages/ to integrations/
The showcase framework directories better reflect their role as
integration examples rather than distributable packages.
Renames showcase/packages/ -> showcase/integrations/ and updates
the test docker-compose file reference accordingly.
2026-04-28 07:47:35 -07:00