mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
24 KiB
24 KiB
Runtime repair iterations
ADK-013 — auth route collision
- Baseline: the Google ADK UI could not start because Next App Router had both
api/copilotkit-auth/route.tsand an equally-specificapi/copilotkit-auth/[[...slug]]/route.ts. - Change: moved the existing auth runtime handler into the catch-all route and removed the conflicting sibling route. The catch-all owns the base runtime endpoint plus V2 subpaths; auth behavior, agent URL, header forwarding, and request hook are unchanged.
- Before/after runtime evidence: pending host start and strict D6
authplus two additional cells.
Fresh isolated RED
- Revision:
b0079629eae9445f82cae66baf674c091da971adin/private/tmp/adk013-baseline. - Command:
PORT=3121 NEXT_TELEMETRY_DISABLED=1 npm --prefix /private/tmp/adk013-baseline/showcase/integrations/google-adk run dev. - Result: Next 15.5.19/Turbopack started then failed with
You cannot define a route with the same specificity as a optional catch-all route ("/api/copilotkit-auth" and "/api/copilotkit-auth[[...slug]]"). - Durable log:
/private/tmp/adk013-baseline-startup.log; the isolated process was stopped after capture.
Green, cell 1/3: auth
- Stack: repaired UI
http://127.0.0.1:3103, agenthttp://127.0.0.1:8001, audit-owned strict local AIMockhttp://127.0.0.1:4410(8630 loaded fixtures). - Command:
AIMOCK_URL_LOCAL=http://127.0.0.1:4410 AIMOCK_URL=http://127.0.0.1:4410 SHOWCASE_LOCAL=1 NEXT_TELEMETRY_DISABLED=1 node_modules/.bin/tsx tasks/docs-feature-audit/run-local-d6.mts google-adk --demo auth. - Result:
d6:google-adk/authgreen (one executed, zero failed) after the auth control revealed the chat input and the request completed throughPOST /api/copilotkit-auth/agent/auth-demo/runand backend/auth. - Durable result:
tasks/docs-feature-audit/repair-adk-auth-d6.log.
ADK local AIMock context default — strict fixture repair
Browser RED without harness headers
- An ordinary local browser flow signed in, sent the D6 fixture prompt
auth check turn 1, and received503 UNAVAILABLE: Strict mode: no fixture matched. The D6 fixture is scoped tocontext: google-adk; the browser does not add the harness-only request header. - The captured backend error excerpt is
tasks/docs-feature-audit/repair-adk-context-baseline-red.log. This is independent of ADK-013: the repaired auth route returned 200 but omitted the fixture namespace on a human local request.
Change and independent review
extractForwardedHeaders()now provides the constantgoogle-adkfixture context only when the server hasAIMOCK_URLconfigured and no inbound context exists. An explicit incoming context remains authoritative.- Independent review found that only an
x-*fixture namespace value is added; Authorization, cookies, and content-type remain excluded, and an unsetAIMOCK_URLpreserves live-provider behavior.
Browser GREEN without harness headers
- A fresh browser context with all non-local requests blocked signed in, sent the same fixture prompt, and rendered the expected confirmation. Screenshot:
tasks/docs-feature-audit/repair-adk-auth-manual-green.png; runner result:tasks/docs-feature-audit/repair-adk-auth-manual-context-proof.log.
D6 regression: 3/3 green
auth:tasks/docs-feature-audit/repair-adk-context-auth-d6.log— 1 passed, 0 failed.agentic-chat:tasks/docs-feature-audit/repair-adk-context-agentic-chat-d6.log— 1 passed, 0 failed.tool-rendering:tasks/docs-feature-audit/repair-adk-context-tool-rendering-d6.log— 1 passed, 0 failed and rendered the weather-card assertion.
LGTS-017 — default Turbopack CVDIAG module resolution
Fresh RED
- Current-source default Turbopack UI compiled
/demos/agentic-chat, but a request to/api/copilotkitreturned 500. Turbopack could not resolve the CVDIAG's NodeNext-style relative.jsmodule specifiers (schema.js,emit.js, andpb-writer-fetch.js). - Command and durable log:
NEXT_TELEMETRY_DISABLED=1 COPILOTKIT_TELEMETRY_DISABLED=true LANGGRAPH_DEPLOYMENT_URL=http://127.0.0.1:8124 ./node_modules/.bin/next dev --turbopack --hostname 127.0.0.1 --port 3101;/private/tmp/lgts017-baseline-turbopack.log.
Change
- Added five source-scoped ESM
.jsbridge modules next to the CVDIAG TypeScript modules. The existing canonical relative.jsspecifiers now resolve under both Turbopack and Webpack without a global alias that could affect dependency imports. - Removed the obsolete Webpack-only extension-alias configuration.
Green
- The same
/api/copilotkitrequest compiled and returned 200 under direct Turbopack (/private/tmp/lgts017-final-turbopack.log) and under the checked-innpm --prefix showcase/integrations/langgraph-typescript run devcommand (/private/tmp/lgts017-default-dev.log). - Strict D6 3/3 green through the final Turbopack UI and local AIMock:
agentic-chat,tool-rendering, andfrontend-toolseach executed one passing cell with zero failures. Logs:tasks/docs-feature-audit/repair-lgts017-final-*-d6.log.
LGTS-017 — complete execution record
Fresh RED
- Command:
cd showcase/integrations/langgraph-typescript && NEXT_TELEMETRY_DISABLED=1 COPILOTKIT_TELEMETRY_DISABLED=true LANGGRAPH_DEPLOYMENT_URL=http://127.0.0.1:8124 ./node_modules/.bin/next dev --turbopack --hostname 127.0.0.1 --port 3101. - Result: the current source compiled
/demos/agentic-chat, butGET /api/copilotkitreturned 500 because Turbopack could not resolve the canonical CVDIAG relative.jsspecifiers. Durable log:/private/tmp/lgts017-baseline-turbopack.log.
GREEN
- Direct Turbopack verification: the same route compiled and returned 200 after the source bridge fix; durable log:
/private/tmp/lgts017-final-turbopack.log. - Default-command verification:
PORT=3101 NEXT_TELEMETRY_DISABLED=1 COPILOTKIT_TELEMETRY_DISABLED=true LANGGRAPH_DEPLOYMENT_URL=http://localhost:8124 OPENAI_API_KEY=sk-mock OPENAI_BASE_URL=http://127.0.0.1:4410/v1 AIMOCK_URL=http://127.0.0.1:4410 npm --prefix showcase/integrations/langgraph-typescript run dev; the default Turbopack command compiled and served/api/copilotkitwith HTTP 200. Durable log:/private/tmp/lgts017-default-dev.log. - Strict local-AIMock D6 regression, all green:
agentic-chat,tool-rendering, andfrontend-tools, each one executed / zero failed. Commands usedAIMOCK_URL_LOCAL=http://127.0.0.1:4410 AIMOCK_URL=http://127.0.0.1:4410 SHOWCASE_LOCAL=1 NEXT_TELEMETRY_DISABLED=1 COPILOTKIT_TELEMETRY_DISABLED=true node_modules/.bin/tsx tasks/docs-feature-audit/run-local-d6.mts langgraph-typescript --demo <id>. Logs:tasks/docs-feature-audit/repair-lgts017-final-agentic-chat-d6.log,tasks/docs-feature-audit/repair-lgts017-final-tool-rendering-d6.log,tasks/docs-feature-audit/repair-lgts017-final-frontend-tools-d6.log. - Independent review: source-scoped ESM bridges preserve canonical CVDIAG imports and remove the bundler-specific alias, with no auth or secret impact.
BIA-007 — Agent Config controls routed to the factory input
Fresh local RED
- Current unmodified demo at
http://127.0.0.1:3117/demos/agent-config; a browser capture selectedenthusiastic/expert/detailedthen sent a neutral sentinel. The outgoingagent/runpayload contained the values only incontext, withforwardedProps: {}. Durable capture:tasks/docs-feature-audit/repair-bia007-current-red.json. - The in-process factory reads only
input.forwardedProps, so it used defaults. The existingagent-configfixture selects canned answers by user-message text and integration context and therefore could not expose this routing fault.
Change and GREEN
- The page now passes its typed config as the provider
propertiesvalue, the contract declared by the Built-in Agent manifest. The obsolete context relay was removed. - The identical browser capture now has the selected
tone,expertise, andresponseLengthinforwardedPropsand no context entry:tasks/docs-feature-audit/repair-bia007-green-request.json. - Strict local-AIMock D6 regression:
agent-configgreen with six completed control turns;agentic-chatgreen with three turns;tool-renderinggreen with its weather-card assertion. Logs:tasks/docs-feature-audit/repair-bia007-agent-config-d6.log,tasks/docs-feature-audit/repair-bia007-agentic-chat-d6.log,tasks/docs-feature-audit/repair-bia007-tool-rendering-d6.log.
Strands C008 — backend recipe state lifting
- Fresh direct builder RED showed the recipe sentinel absent from the outgoing model prompt while existing preference state was present. The backend had no
state.recipebranch. - The state-context builder now formats the recipe snapshot on every turn. Direct sentinel GREEN:
tasks/docs-feature-audit/repair-strands008-recipe-builder-green.txtcontains both the title and ingredient sentinels. - The Strands fixture now requires the emitted
Current recipe from the editormarker. The pre-readiness strict D6 RED is retained intasks/docs-feature-audit/repair-strands008-recipe-prompt-gated-d6.log(AIMock 503 no fixture match). After the repair it is green intasks/docs-feature-audit/repair-strands008-recipe-prompt-gated-green3-d6.log.
REPAIR-006 — shared recipe initialization readiness race
- Separate from C008: the shared React page seeded a provisional
useAgentobject in an empty-dependency effect. Runtime synchronization then replaced that object, so the first real request could omit recipe state. - The canonical page waits for
isReady, seeds the synchronized agent, and exposes the sidebar/send path only after initialization. It is materialized identically into Strands, LangGraph Python, and LangGraph TypeScript byshowcase/scripts/sync-shared-frontends.ts; CI runs the checker fromshowcase_validate.yml. - Focused fanout test: one worker / no file parallelism,
tasks/docs-feature-audit/repair-shared-frontend-fanout-test.log— 1 passing test. - Fresh strict D6 GREEN (one stack at a time): Strands
repair-shared-frontend-strands-shared-state-read-d6.log(7.3s), LangGraph Pythonrepair-shared-frontend-langgraph-python-shared-state-read-d6.log(8.9s), LangGraph TypeScriptrepair-shared-frontend-langgraph-typescript-shared-state-read-d6.log(12.4s). Each ran two shared-probe turns with one pass and zero failures. - The first LangGraph TypeScript retry was invalid setup only: local
AGENT_URLwas ignored and the runtime retained its defaultlocalhost:8123; the correctedLANGGRAPH_DEPLOYMENT_URL=http://localhost:8124green result above is authoritative. Audit stacks were stopped after every cell; final listener check found no audit ports or probe workers, and only pre-existing cpki containers remained.
LangGraph Python — scoped latest stable dependency compatibility
- PyPI metadata was read on 2026-09-10. The audited latest set is
copilotkit 0.1.96,ag-ui-protocol 0.1.22,ag-ui-langgraph 0.0.45,langchain 1.4.0,langgraph 1.2.11,langgraph-cli[inmem] 0.4.31,langgraph-api 0.14.0,langsmith 0.12.4, anddeepagents 0.7.13.deepagents 0.7.13requireslangsmith >=0.11.2andlangchain-anthropic >=1.7.0, solangchain-anthropicis upgraded to1.7.2. Existinglangchain-openai 1.1.9andopenai 1.109.1resolve unchanged and were intentionally left outside this compatibility-driven update. - Resolver evidence: the first proposed
langchain 1.5.11target was rejected because that release does not exist on PyPI;stable-langgraph-python-uv-pypi-dry-run.logrecords the correction.stable-langgraph-python-core-only-dry-run.logandstable-langgraph-python-core-compatible-dry-run.logrecord the two direct dependency conflicts above. The final minimal compatible resolver is green instable-langgraph-python-core-compatible2-dry-run.log. - Isolated environment install:
/private/tmp/copilotkit-host-native-python/langgraph-python; durable log/private/tmp/langgraph-python-stable-install.log. All upgraded framework and adapter imports succeeded. - Local stack: latest agent
127.0.0.1:8123, Showcase UI127.0.0.1:3100, strict isolated AIMock127.0.0.1:4410, fake provider variables only. The agent booted and loaded the full graph catalog underlanggraph-api 0.14.0. - Strict D6 green:
agentic-chat(3 turns,stable-langgraph-python-agentic-chat-d6.log),tool-rendering(weather-card assertion,stable-langgraph-python-tool-rendering-d6.log), andshared-state-read(2 turns,stable-langgraph-python-shared-state-read-d6.log). Each executed one cell with zero failures. - Scope limit: this establishes three representative current-source cells after the Python dependency change. It does not qualify LangGraph Python's full routed-feature matrix, media paths, guide rendering, or the still-old JavaScript frontend CopilotKit packages; those remain separate gates.
REPAIR-011 — latest published core rejects relative runtime URLs
Fresh RED on published 1.71.0
- Built-in Agent was upgraded to published CopilotKit
1.71.0packages and normally installed from its regenerated lockfile. Its local UI started athttp://127.0.0.1:3117; strict AIMock washttp://127.0.0.1:4410with fake provider variables only. - The existing browser provider URL is relative (
/api/copilotkit). The runtime sentGET /api/copilotkit/info(404) andPOST /api/copilotkit(200), then the browser raisedFailed to construct 'URL': Invalid URLbefore the agent or AIMock ran. Strictagentic-chatreproduced the failure twice and had zero AIMock journal entries:tasks/docs-feature-audit/stable-built-in-agent-agentic-chat-d6.log. - Separate local iframe/browser evidence selected
professional/intermediate/concise, sent literaltone:professional, and showed the same error without an assistant response. This is current published-SDK evidence, not a fixture mismatch.
Shared owning source and scope
packages/core/src/utils/single-route-resource-request.tsconstructednew URL(runtimeUrl)without a browser base, while 206 selected-five frontend providers pass relative/api/...runtime URLs. The shared core source now resolves those paths against the browser location and keeps absolute server runtime URLs valid; its focused regression tests cover relative browser and absolute server inputs.- This needs a new CopilotKit package release before the selected demos can claim latest published SDK qualification. The local build/relink and D6 green proof are tracked separately from the published-1.71.0 RED.
Built-in Agent dependency checkpoint (2026-09-13)
- Independent lock review found all five direct CopilotKit dependencies pinned and resolved from the public registry, with no
file:,link:, workspace, or/privatesource in the lock. It also found the directcmdk1.1.1 andopenai6.49.0 changes coherent with React 19, root Zod 4, and the installed TanStack OpenAI adapter. - A normal registry
npm ci --dry-run --ignore-scriptsresolver run completed. Its proposed node_modules changes show that the pre-pause local tree still contains the test-only patched-core overlay; this is not clean-install proof. - Official npm registry latest tags observed before the registry DNS interruption: every direct CopilotKit package moved to 1.71.1. The current committed 1.71.0 pins are therefore stale.
cmdkremains 1.1.1; OpenAI and TanStack releases also advanced, but they require a compatibility decision rather than an automatic major upgrade. - Next gate: update the direct CopilotKit set to 1.71.1, perform a real normal
npm ci --ignore-scriptsfrom the registry to replace the overlay, record installed versions, then run scoped local strict-AIMock proof. Until then, neither 1.71.0 nor the patched local core establishes latest-published qualification.
Built-in Agent 1.71.1 clean-install result
- The five direct CopilotKit pins and registry lock were updated to 1.71.1. A real
npm ci --ignore-scriptscompleted successfully from the final lock, installed 947 packages, and replaced the test-only local core overlay. - Installed direct graph:
@copilotkit/a2ui-renderer,react-core,core,runtime,shared, andvoiceare all 1.71.1;cmdkis 1.1.1; rootopenaiis 6.49.0; the voice package keeps its declared nested OpenAI 5.23.2. The lock has nofile:,link:, or/privatesource. - The lockfile-update log is
/private/tmp/built-in-agent-ck1711-lock-update.log; the normal clean-install log is/private/tmp/built-in-agent-ck1711-normal-ci.log. The next required evidence is a no-overlay published-1.71.1 local strict-AIMock probe; it has not yet run.
Published 1.71.1 no-overlay probe
- The 1.71.1 registry install started cleanly with the local UI and strict fixture-only AIMock healthy.
agentic-chatthen failed on both D6 retry attempts before AIMock received a request: the browser raisedFailed to construct 'URL': Invalid URLwithagent_run_failedand no assistant response. - Durable result:
tasks/docs-feature-audit/stable1711-built-in-agent-agentic-chat-d6.log. This is a fresh latest-published reproduction, not a leftover patched dependency or fixture miss. - The shared core repair in commit
6e7ad99316has not been released in the current 1.71.1 registry artifacts. Built-in Agent cannot qualify against latest published CopilotKit until a release includes that repair; no per-demo workaround is appropriate.
REPAIR-013 — Built-in Agent local AIMock context fallback
Browser RED and cause
- After the unreleased local core overlay allowed the browser to reach the model, the embedded Built-in Agent
agent-configguide selectedprofessional/intermediate/concise, senttone:professional, and received503 Strict mode: no fixture matched. - The local AIMock journal (
/private/tmp/aimock-journal-bia-browser-red.json) shows all three selected values in the outbound system prompt, but nox-aimock-contextrequest header. The integration-scoped fixture correctly rejected that context-less request; the controls channel itself was not broken.
Change and verification
- The shared Built-in Agent header-forwarding shim now supplies
built-in-agentonly whenAIMOCK_URLis explicitly configured and an incoming request did not already setx-aimock-context. Explicit D6 context remains authoritative; a live-provider run withoutAIMOCK_URLretains its prior headers. - Root repeated the original local browser flow after the change: the same professional/intermediate/concise controls and
tone:professionalrendered the professional reply without a 503. - Shared strict D6 regression:
tasks/docs-feature-audit/repair013-built-in-agent-agent-config-d6.log— six control turns, zero failures. - Reader-flow fixture: the Built-in Agent fixture now requires the natural prompt
Introduce yourself in the style I selected.plusbuilt-in-agentcontext and all three selected prompt fields (tone=casual,expertise=expert,responseLength=detailed). Root's local browser selected casual/expert/detailed and received the explicit replyActive config: casual tone, expert expertise, detailed response length.... - This is strict local replay evidence on the patched local core build. The current public 1.71.1 core remains separately red for relative runtime URLs until the shared repair is released.
REPAIR-021 — Built-in Agent V2 multi-route runtime handling
Fresh RED
- The V2 client requested
GET /api/copilotkit-multimodal/info; the former base-only App Router handler returned 404. Durable headers/body:/private/tmp/bia-info-before.headersand/private/tmp/bia-info-before.body. - Changing only the App Router path made that request reach the handler but return 405, proving that its explicit
single-routemode could not serve V2/info.
Change
- Moved the base runtime handlers to optional App Router catchalls and removed their explicit single-route mode. The base runtime URLs remain unchanged; the V2 handler now serves
/infoandPOST /agent/:id/runbelow each endpoint. - Updated Built-in Agent manifest highlights to the catchall paths. Generated registry inputs remain derived.
- Updated the canonical readonly-state probe to accept either the supported legacy JSON-RPC
agent/runenvelope at a base runtime URL or a V2 raw POST whose pathname ends in/agent/:id/run. Resource and stop requests remain excluded. Regression coverage includes a raw V2 run followed by a resource request and a raw body on a non-run route.
Green / current boundary
GET /api/copilotkit-multimodal/infonow returns 200:/private/tmp/bia-info-after.headersand/private/tmp/bia-info-after.body.- Focused shared probe regression is green, 12 tests:
/private/tmp/repair020-readonly-probe-test.log. - Strict local-AIMock readonly BIA cell is green:
tasks/docs-feature-audit/repair021-built-in-agent-readonly-multiroute-green.log. The UI log recordsGET /api/copilotkit/info200 andPOST /api/copilotkit/agent/readonly-state-agent-context/run200. - The multimodal sample-button D6 cell remains red after this transport repair:
tasks/docs-feature-audit/repair020-built-in-agent-multimodal-after-multiroute-red.log. Both attempts reachGET /infoandPOST /agent/multimodal-demo/runwith HTTP 200, but the click occurs during the provisional-agent window and no message survives in the DOM. A normal delayed browser image and PDF action is green. The shared sample-buttonisReadygate is a separate canonical frontend repair; do not count multimodal green until its strict replay passes.
REPAIR-020 — canonical multimodal sample-button readiness
- After REPAIR-021 restored V2
/infoand run transport, the strict multimodal D6 still clicked a sample button during the provisional-agent window. Both retries reached the backend and returned HTTP 200 but no user or assistant message remained in the DOM:tasks/docs-feature-audit/repair020-built-in-agent-multimodal-after-multiroute-red.log. - A delayed local browser image and PDF action succeeded, identifying readiness rather than attachment data or fixture matching as the boundary.
- The single canonical sample-button source now waits for
useAgent().isReady, visibly disables the sample actions while connecting, and defensively rejects a stale provisional instance. It is materialized into all five selected React integrations byshowcase/scripts/sync-shared-frontends.ts. - The unchanged strict shared D6 now passes both image and PDF turns:
tasks/docs-feature-audit/repair020-built-in-agent-multimodal-readiness-green.log(one cell passed, zero failed). This is a repaired behavior result, not a relaxed probe.
Built-in Agent strict-turn full-matrix checkpoint
- Explicit qualification-mode AIMock (
AIMOCK_STRICT_TURN_INDEX=1) ran all 39 current BIA D6 checks against the existing local UI and fixture-only mock: 37 passed, 2 failed, no checks skipped. Durable aggregate:tasks/docs-feature-audit/repair021-built-in-agent-full-d6-strict-turn.log. threadid-frontend-tool-roundtripfails with503 Strict mode: no fixture matched. It is deliberately a manifest feature without ademos:entry, so this is retained as unshipped/non-applicable evidence rather than omitted or treated as a published guide cell.voicehas no request start or user/assistant DOM after the immediate sample-button click (runStartCount=0). Its sample writes the composer during the provisional-agent window, before CopilotChat enables submit after runtime discovery. The byte-identical five-integration voice components need the same canonicalisReadygate as multimodal; its repair/replay is pending at this checkpoint.
Final strict qualification replay
- After the canonical voice readiness gate, the complete strict-turn replay ran 39 checks against the local Built-in Agent UI and fixture-only AIMock:
tasks/docs-feature-audit/repair021-built-in-agent-full-d6-strict-turn-final.log. - Raw result: 38 passed, 1 failed. The only failure is
threadid-frontend-tool-roundtrip, which made two real attempts and received503 Strict mode: no fixture matched. The Built-in Agent manifest declares this as a feature but contains nodemos:entry; it is retained as an unshipped, non-applicable raw-matrix failure rather than silently skipped. - Published-catalog result: 38 applicable cells passed. This result uses the strict local AIMock qualification configuration and the local core artifact patched only with unreleased REPAIR-011 relative-URL behavior. It does not qualify the latest published CopilotKit 1.71.1 artifact, which remains red until that shared repair is released.
- Voice’s strict D6 and normal-browser sample are green only for the bundled text-transcript handoff. Neither exercises microphone capture nor WAV upload/transcription; that provider/API path remains untested.