Refine response language policy and reduce prompt costs - #2792
Merged
Conversation
Fix response language policy for agent completions
The policy block from #257 was injected on every turn, in the system prompt and again in the done tool description, with no prompt-tier gate. On the compact tier that was roughly 10% of a 1,500-token base prompt, paid twice, to say "answer in English" in the common case. Ordinary policies now render as one line of about 40 tokens. Translation targets, multilingual deliverables, approved-plan overrides, and synthetic Continue resumptions keep the full wording, since those are the cases the original fix was about. Compact tier uses the short rendering wherever it can still carry the deliverable language. The done schema no longer repeats the instruction on normal turns. Forced terminal delivery keeps both copies: that turn has one shot and no planner context, which is what #257 fixed. Also stop discarding an explicitly empty deliverable_locales list. A planner answer of "no fixed target, source may be translated" is coherent and is now kept; a list whose entries are all invalid still fails closed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The short form ended in an unconditional "never translate ... product names, or personal names". The full form allows it when the user explicitly asks, so a compact-tier model reading the short form could leave a requested product name or transliteration untouched. Costs about 17 tokens: ordinary policies go from 43 to 60, the planner-bypass fallback from 58 to 75. Still well under the 150 the full block charges. Reported by codex on #258. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Trim the response-language policy prompt cost
|
@esokullu is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.