Update rag.md -- remove fancy quotes#3
Merged
Conversation
pavelgj
pushed a commit
that referenced
this pull request
May 1, 2024
Co-authored-by: Chris Chestnut <cchestnut@google.com> Co-authored-by: Cleo Schneider <cleoschneider@google.com> Co-authored-by: Samuel Bushi <ssbushi@google.com>
pavelgj
pushed a commit
that referenced
this pull request
May 1, 2024
inlined
added a commit
to inlined/genkit
that referenced
this pull request
Nov 15, 2024
Example is for structured output but the schema was string.
cabljac
referenced
this pull request
in invertase/genkit
Nov 25, 2025
Co-authored-by: Chris Chestnut <cchestnut@google.com> Co-authored-by: Cleo Schneider <cleoschneider@google.com> Co-authored-by: Samuel Bushi <ssbushi@google.com>
3 tasks
chrisraygill
added a commit
that referenced
this pull request
May 29, 2026
…upes, dead schema Four implementation simplifications that don't change observable behavior (except #3, which tightens the tool-error contract). 1) Consolidate snapshot rehydrate + background poll into a single `applySnapshot(snapshotId)` helper on `AgentSession`. Both methods previously did the same runFlow → state.{messages,artifacts,custom} → check status logic with subtle drift (the poll handled 'aborted', rehydrate didn't). The helper returns the snapshot's terminal status; callers decide their own phase semantics. `continueFrom` also routes through it. ~30 LOC of duplication gone. 2) Drop the StrictMode dispose dance from the React adapter. The trickiest 15 LOC in the whole stack — Promise.resolve().then + hasActiveSubscribers() check + microtask deferral — goes away. Replaced with a `listeners.size === 0` self-termination check inside `startBackgroundPoll`: when no one is subscribed, the poll stops on its next tick. `useSyncExternalStore` already manages subscribe/unsubscribe correctly, so the listener Set empties on unmount. AbortControllers are GC-safe. No explicit dispose needed from the adapter; the session lazy-init via useRef just works under StrictMode's double-mount. `hasActiveSubscribers()` removed from the public API. 3) Make `metadata.toolError` the only `tool-error` detection signal. Drop the two heuristic fallbacks (`{error}`/`{status:'error'}` shape, and the `Tool '<name>' failed:` string match) from `detectToolError`. Patch the stock filesystem middleware to set `metadata.toolError = { message }` on the response envelope so the runtime can find it. Detection lives at one explicit opt-in flag; the implementation now matches the protocol's promise of "no more string matching". Third-party middleware that catches tool throws and returns error-shaped responses without setting the flag won't surface as `tool-error` events — the conversation still proceeds (model sees the error in output) but the typed client signal is gone. Documented tradeoff. Bug caught while wiring this up: the metadata flag lives on the *part* envelope, not on the `toolResponse` value. The runtime now passes both to the detector. 4) Drop the unused `artifact-start`/`artifact-delta`/`artifact-complete` schema variants from `AgentStreamChunkSchema` (and the matching client visitor case). The schema comment had been calling them "reserved; runtime emits artifact-emitted for now" since they were introduced — three reserved-but-never-emitted variants is protocol noise. Add them back at the moment the emission site exists. End-to-end verified: - React: WeatherChat tool-call lifecycle + BankingInterrupt in-stream interrupt + URL push. Zero errors. - Angular: WeatherChat + BankingInterrupt + BackgroundAgent (phase transitioned background → done at t=18s, 9.5KB report). Zero errors. - tool-error event still fires via metadata signal: 2 events emitted in a curl test driving read_file ENOENT (one for list_files probe, one for read_file), each with addressable toolCallId and clean errorText. Net LOC across all four: ~80 saved, plus the React adapter's trickiest code path retired. Protocol vocabulary contracts from 12 variants to 10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.