Skip to content

Tell the LLM that tool outputs are limited and may be truncated#2823

Open
onmete wants to merge 1 commit intoopenshift:mainfrom
onmete:fix/add-tool-truncation-guidance-to-prompt
Open

Tell the LLM that tool outputs are limited and may be truncated#2823
onmete wants to merge 1 commit intoopenshift:mainfrom
onmete:fix/add-tool-truncation-guidance-to-prompt

Conversation

@onmete
Copy link
Contributor

@onmete onmete commented Mar 17, 2026

Description

AGENT_SYSTEM_INSTRUCTION had no mention of tool output size limits. The LLM had no reason to prefer targeted, scoped queries over broad ones that pull large amounts of data — which is a contributing factor to frequent truncation in practice.

Add one sentence to the instruction:

* Tool outputs are limited in size and may be truncated. Prefer specific, targeted tool calls over broad queries that return large amounts of data.

This gives the LLM the context it needs to plan more efficient tool calls from the start, before any truncation occurs.

Type of change

  • Optimization

Related Tickets & Documents

  • Related Issue #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.

Testing

  • All 883 unit tests pass (make test-unit).
  • make verify passes (black, ruff, pylint 10/10, mypy clean).
  • Existing prompt generator tests are unaffected — they patch AGENT_SYSTEM_INSTRUCTION out, so they are insensitive to its content.

Made with Cursor

The agent system prompt had no guidance about tool output size limits.
The LLM had no reason to prefer targeted queries over broad ones that
return large amounts of data, contributing to frequent truncation.

Add a brief instruction to AGENT_SYSTEM_INSTRUCTION so the LLM plans
its tool calls accordingly from the start.

Made-with: Cursor
@openshift-ci openshift-ci bot requested review from bparees and xrajesh March 17, 2026 13:31
@openshift-ci
Copy link

openshift-ci bot commented Mar 17, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign raptorsun for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@openshift-ci
Copy link

openshift-ci bot commented Mar 17, 2026

@onmete: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/fips-image-scan-service e6e5442 link true /test fips-image-scan-service

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant