Repository navigation
요청 한도를 넘을 때만 오래된 도구 출력 본문 생략(ADR-0097 1단계) - #171
Draft
SonAIengine wants to merge 3 commits into
Draft
SonAIengine wants to merge 3 commits into
SonAIengine wants to merge 3 commits into
Conversation
Terminal-Bench 2.1 약한 모델 측정에서 끝난 73과업 중 실패 47개의 57%(27개)가 request_too_large로 Run이 끝났다. 평균 구성은 toolOutputs 74 KB, capabilities 22 KB, steps 14 KB다. 원인은 둘이다. planning context 예산 (512 KiB)과 agy transport 한도(100,000바이트)가 따로 있다. 그리고 도구 출력은 packing 대상이 아니라 항상 원문 전부가 들어간다. 1단계 제안: planner port 한도를 예산의 단일 출처로 쓰고, 넘칠 때만 오래된 출력 본문을 stub으로 바꾼다(최근 3개 보존, 75%까지 내려 cache 보존). 한도 안의 요청은 바이트가 같다. 생략 순서는 설계 14·held-out 13 과업으로 측정해 고른다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terminal-Bench 2.1 약한 모델 실험에서 실패 47개 중 27개가 request_too_large로 끝났다. planning 예산(512 KiB)과 agy prompt 한도(100,000바이트)가 따로 있었고, toolOutputs는 packing 대상이 아니라 평균 74 KB가 항상 원문으로 들어갔다. - PlannerPort::max_context_bytes로 transport 한도를 context builder에 알린다. agy는 prompt_limit(), HTTP는 XGEN_OPENAI_MAX_PROMPT_BYTES(16 KiB~1 MiB)로만 켠다. 한도 = prompt 한도 - system prompt 길이 - envelope 여유 2,048바이트. - 넘칠 때만 최근 3개를 뺀 오래된 출력부터 본문을 빼고 elided stub과 고정 문장을 남긴다. 넘친 양을 예산 1/4 단위로 올림해 생략 앞부분을 고정, prefix cache 재사용을 지킨다. - 원문은 journal·tool_outputs에 그대로 있고 모델에 보내는 view만 바뀐다. 검증: cargo test --workspace 실패 0, clippy -D warnings 통과, 새 테스트 3개. diff-model-requests base/head 8개 사례 모두 차이 0(한도 안 요청 바이트 동일). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
배경
Terminal-Bench 2.1 약한 모델 실험(agy
gemini-3.8-flash-low)의 89과업 기준선은 34개 통과(38%)다. 실패 55개 중 32개가model_rejected.request_too_large로 끝났다. 모델은 계속할 수 있었는데 host가 요청을 보내지 못했다.toolOutputs는 packing 대상이 아니라 항상 원문이었다. 넘친 요청의 평균 크기는 74 KB였다.변경
PlannerPort::max_context_bytes: transport 한도를 context builder에 알린다.prompt_limit()을 쓴다.XGEN_OPENAI_MAX_PROMPT_BYTES(16 KiB~1 MiB)를 줄 때만 켠다. 기본 동작은 그대로다.elided: true와 고정elidedMeaningstub을 남긴다.검증
cargo test --workspace실패 0, 새 테스트 3개 추가.clippy --workspace --all-targets -D warnings통과.scripts/diff-model-requests.py --base <main bin> --head <this bin>: 8개 사례 모두 differences 0, "model requests match". 한도 안의 요청은 바이트가 같다.🤖 Generated with Claude Code