Skip to content

fix: stop A2A answers truncating at 30s, and ground/cite agent replies - #234

Merged
google-oss-prow[bot] merged 7 commits into
kubeflow:mainfrom
kmr-rohit:fix/a2a-stream-timeout-and-citations
Aug 21, 2026
Merged

google-oss-prow[bot] merged 7 commits into
kubeflow:mainfrom
kmr-rohit:fix/a2a-stream-timeout-and-citations

Conversation

@kmr-rohit

Copy link
Copy Markdown
Contributor

Summary

Long chatbot answers were being cut off mid-word. It looked like an output-token
cap, but vLLM was receiving max_tokens of 29357–31831 per request and logged
zero aborted requests — the model finished every time. Two 30s deadlines in
series were killing the response instead:

  • The gateway-guardrails catch-all route also governed /a2a/, where the
    response streams for the whole generation rather than returning at once.
    Envoy closed the SSE stream mid-token.
  • kagent's LLM client timeout was unset. This one also suppressed the final
    aggregated message for the turn, so nothing repaired the partial text.

Fixing only the first still truncated at 32s, which is what surfaced the second.

While verifying, three answer-quality faults showed up in the same replies:

  • No sampling params were set, so vLLM fell back to Qwen's packaged generation
    config (temperature 0.7 / top_p 0.8). At that setting the model drifted
    mid-sentence into Chinese inside a code block and asserted that Katib is not
    part of Kubeflow.
  • search_kubeflow_code was attached only to the debug agent, so the docs agent
    had nothing to ground manifest questions on and invented YAML schemas.
  • Citations were requested by the prompt but never appeared.

Separately, a wide code block collapsed the expanded panel's persona sidebar,
because .main-content keeps min-width: auto under flex: 1 and refuses to
shrink below its widest line.

Changes

File Change
charts/gateway-guardrails/{templates/virtualservice,values}.yaml Route /a2a/ at 300s; catch-all stays capped at 30s
manifests/kagent/setup.yaml temperature 0.1 / topP 0.9 / timeout 300; add search_kubeflow_code; require a Sources list; correct the component list; forbid plan narration
frontend/docs_styles/chatbot.css min-width: 0 down the flex chain, hold sidebar width, keep the code scrollbar visible

Verification

Ran the three demo queries against the live agent via the public A2A endpoint:

Query Length Complete Citations
Configure Katib hyperparameter tuning 2009 chars yes 2 URLs
Istio gateway 404 on the dashboard 1421 chars yes 5 URLs
Katib Experiment YAML example 1323 chars yes 1 URL

Previously all three stopped mid-word around 900–1200 characters. Partial and
final stream copies now match exactly, with zero unparseable SSE events, and the
Chinese drift and "Let's search..." narration are gone.

Known gaps, not addressed here

  • Manifest answers still get the schema wrong. code_rag holds 4302 entities
    that are all install manifests (1356 CRDs, 427 ConfigMaps, RBAC) with no
    example workloads. The experiments.kubeflow.org CRD is indexed, so the
    schema is reachable, but the 7B model does not use it even when instructed
    not to guess. Indexing real example CRs is the likely fix.
  • Citations render as unclickable text: formatMarkdown in chatbot.js handles
    only code fences, inline code, newlines and bold, so [text](url) and ###
    come out literal. Needs a follow-up in the widget.
  • routing.cors.allowOrigins in the chart lists only the Netlify origin, while
    the live cluster also carries a hand-added Vercel origin. A helm/terraform
    apply from this chart would drop it. Left alone deliberately; worth reconciling
    separately.

…t off

The single 30s cap on the catch-all route also governed /a2a/, where the
response streams for the whole generation rather than returning at once. A
grounded answer on the 7B model routinely runs past 30s, so Envoy closed the
SSE stream mid-token and the chatbot rendered a sentence that stopped in the
middle of a word — indistinguishable from the model truncating.

Route /a2a/ separately at 300s, matching the Knative revision timeout on the
predictor, and leave the catch-all capped so an ordinary hung request still
can't pin a worker.

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
Three faults showed up in the same set of answers:

The ModelConfig set no sampling params, so vLLM fell back to Qwen's packaged
generation config (temperature 0.7 / top_p 0.8). At that setting the model
drifted mid-sentence into Chinese inside a code block, claimed Katib is not
part of Kubeflow, and ignored the prompt's length guidance. Pin near-greedy
decoding instead, and set an explicit client timeout — the default cut
generation mid-token and left the turn with no final aggregated message.

The docs agent could not see manifests at all: search_kubeflow_code was
attached only to the debug agent, so YAML questions had nothing to ground on
and the model invented schemas. Attach it here and route manifest questions to
it first. The index holds install manifests and CRDs rather than example
workloads, so point the model at the relevant CRD for the authoritative field
layout.

Citations were requested by the prompt but never produced. Require a Sources
list built from the "**Source:**" URLs the tools return, restricted to URLs
actually retrieved.

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
.main-content is a flex item with flex:1, which leaves min-width at auto, so
it refused to shrink below the intrinsic width of its widest line. One long
unwrappable line in a code block therefore pushed it wider than the panel:
the persona sidebar next to it absorbed all the shrinkage and squeezed down to
a sliver, and the overflow past the container was silently clipped by
overflow:hidden.

Let the column shrink, hold the sidebar at its declared width, and keep the
code block's own scrollbar visible so a wide sample reads as scrollable rather
than cut off.

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
@kmr-rohit
kmr-rohit force-pushed the fix/a2a-stream-timeout-and-citations branch from fe91d93 to c60b9a3 Compare August 18, 2026 22:10
@kmr-rohit
kmr-rohit marked this pull request as ready for review August 18, 2026 22:12
@kmr-rohit

Copy link
Copy Markdown
Contributor Author

Hi @tarekabouzeid , Please review and merge. Most of changes are on widget ui fixes , prompt changes to give citations , few changes on Tests suit.

Address review feedback on kubeflow#234: embedding vector dimensions vary by
model, and docs TEI truncation should not be a hardcoded constant.
Expose embedding_dim and max_tei_chars as pipeline params (with shared
defaults), and keep chunk_size/chunk_overlap defaults wired through the
same constants.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Rohit Kumar <kmr-rohit@users.noreply.github.com>
@kmr-rohit

Copy link
Copy Markdown
Contributor Author

@tarekabouzeid , Addressed issues , Please review and merge.

@tarekabouzeid

Copy link
Copy Markdown
Member

Thanks so much @kmr-rohit !
/lgtm
/approve

@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tarekabouzeid

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit b24399e into kubeflow:main Aug 21, 2026
1 check passed
Sharkyii pushed a commit to Sharkyii/docs-agent that referenced this pull request Aug 28, 2026
kubeflow#234)

* fix(gateway): give A2A streaming its own timeout so answers aren't cut off

The single 30s cap on the catch-all route also governed /a2a/, where the
response streams for the whole generation rather than returning at once. A
grounded answer on the 7B model routinely runs past 30s, so Envoy closed the
SSE stream mid-token and the chatbot rendered a sentence that stopped in the
middle of a word — indistinguishable from the model truncating.

Route /a2a/ separately at 300s, matching the Knative revision timeout on the
predictor, and leave the catch-all capped so an ordinary hung request still
can't pin a worker.

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>

* fix(kagent): settle decoding, add manifest search, and require citations

Three faults showed up in the same set of answers:

The ModelConfig set no sampling params, so vLLM fell back to Qwen's packaged
generation config (temperature 0.7 / top_p 0.8). At that setting the model
drifted mid-sentence into Chinese inside a code block, claimed Katib is not
part of Kubeflow, and ignored the prompt's length guidance. Pin near-greedy
decoding instead, and set an explicit client timeout — the default cut
generation mid-token and left the turn with no final aggregated message.

The docs agent could not see manifests at all: search_kubeflow_code was
attached only to the debug agent, so YAML questions had nothing to ground on
and the model invented schemas. Attach it here and route manifest questions to
it first. The index holds install manifests and CRDs rather than example
workloads, so point the model at the relevant CRD for the authoritative field
layout.

Citations were requested by the prompt but never produced. Require a Sources
list built from the "**Source:**" URLs the tools return, restricted to URLs
actually retrieved.

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>

* fix(widget): stop a wide code block collapsing the persona sidebar

.main-content is a flex item with flex:1, which leaves min-width at auto, so
it refused to shrink below the intrinsic width of its widest line. One long
unwrappable line in a code block therefore pushed it wider than the panel:
the persona sidebar next to it absorbed all the shrinkage and squeezed down to
a sliver, and the overflow past the container was silently clipped by
overflow:hidden.

Let the column shrink, hold the sidebar at its declared width, and keep the
code block's own scrollbar visible so a wide sample reads as scrollable rather
than cut off.

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>

* fix: improve retrieval quality and widget citations

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>

* test: align retrieval checks with CI

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>

* test: skip KFP component checks without SDK

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>

* fix(pipelines): parameterize embedding dim and TEI/chunk sizing

Address review feedback on kubeflow#234: embedding vector dimensions vary by
model, and docs TEI truncation should not be a hardcoded constant.
Expose embedding_dim and max_tei_chars as pipeline params (with shared
defaults), and keep chunk_size/chunk_overlap defaults wired through the
same constants.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Rohit Kumar <kmr-rohit@users.noreply.github.com>

---------

Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Rohit Kumar <kmr-rohit@users.noreply.github.com>
Signed-off-by: Sneh Kansagara <snehkansagara@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants