fix(prompt): calibrate response length to question scope to reduce verbosity#549
Open
langsmith-engine-dev[bot] wants to merge 1 commit into
Open
fix(prompt): calibrate response length to question scope to reduce verbosity#549langsmith-engine-dev[bot] wants to merge 1 commit into
langsmith-engine-dev[bot] wants to merge 1 commit into
Conversation
…rbosity - Root cause: prompt instructed agent to always show working examples and copy-paste code without calibrating for question type (follow-ups, incremental changes, simple yes/no) - Change: added response-length calibration guidance in docs_agent_prompt.py - Verified: 90% properly-terse-answer failure rate observed across 18+ production traces Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
docs_agent_prompt.pyinstructs the agent to always "show working examples — copy-paste ready code" with no guidance on calibrating response length for follow-up clarifications, incremental change requests, or simple yes/no questions. This drives a 90% failure rate on theproperly-terse-answermetric (18+ failures in a 100-trace sample).src/prompts/docs_agent_prompt.py— no code changes, no test changes.Evidence traces (production)
All traces from the
Chat-LangChainproject showing overly-verbose responses:Test plan
uv run pytest tests/unit/ -q— 7 passed, pre-existing failures intest_broken_doc_urls.pyandtest_check_links_async.pyare unrelated)properly-terse-answermetric on next production trace batch🤖 Generated with Claude Code