Skip to content

fix(context): single-shot artifact_read to avoid paging loops - #15

Merged
ayman3000 merged 1 commit into
mainfrom
fix/contextsift-single-shot-retrieval
Jul 27, 2026
Merged

fix(context): single-shot artifact_read to avoid paging loops#15
ayman3000 merged 1 commit into
mainfrom
fix/contextsift-single-shot-retrieval

Conversation

@ayman3000

Copy link
Copy Markdown
Owner

Context

Follow-up to #14. Live-testing the ContextSift fix against glm-5.2:cloud surfaced a second, related weakness: with a >8k tool output, retrieval is paginated (artifact_read returns 8k at a time with "call again with offset…"), and a weaker model can loop on the paging instead of converging — one run hit maxTurnsReached(8).

Fix

  • Raise artifact_read's default read limit 8000 → 24000, so a retrieval usually returns the whole artifact in a single call. The model can still page explicitly via offset/limit for very large artifacts.

Validation

  • Gated live regression liveContextSiftNoArtifactReadLoop: a ~22k listing (sentinel past the inline preview) through a ContextManager, asserting the run finishes with no retrieval spiral. 3/3 passes, 0 artifact_read calls each run after the fix.
  • All 96 hermetic tests pass.

🤖 Generated with Claude Code

Raise artifact_read's default read limit 8000 -> 24000 so retrieval
typically returns the whole artifact in one call. Paginated reads
(repeated "call again with offset…") could make weaker models loop
rather than converge on an answer.

Adds a gated live regression (liveContextSiftNoArtifactReadLoop) that
runs a >8k tool output through a ContextManager against glm-5.2:cloud and
asserts the run finishes without an artifact_read spiral (observed 0 reads
across repeated runs after the fix).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@ayman3000
ayman3000 merged commit 90c76f2 into main Jul 27, 2026
1 check passed
@ayman3000
ayman3000 deleted the fix/contextsift-single-shot-retrieval branch July 27, 2026 17:05
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