Repository navigation
Bound tool output and recover oversized model context - #52
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…paction pinning - Stage snapshot replacements with the target's Unix mode before writing content, and report a target deleted mid-staging as stale. - Document that snapshot publication does not keep owner/ACLs/xattrs. - write_file and edit_file take the shared semantic-write lock. - REPL: keep the session open on non-provider prompt failures; return nonzero for unknown slash commands and failed custom commands; keep the last exit code on idle Ctrl+C. - Compaction: check the summary budget only once compaction is needed, and pin the turn's original request as well as the latest correction. - Keep provider-reported usage when the response text is empty. - Add coverage for staging recheck, precheck cancellation, snapshot symlink escape, unfinished primary compaction, and cancel isolation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ontrol' into codex/runtime-resilience # Conflicts: # src/SharpClaw.Code.Runtime/Context/AutomaticContextManager.cs
Telli
changed the base branch from
codex/snapshot-compaction-live-control
to
main
November 6, 2026 03:14
Telli
marked this pull request as ready for review
November 6, 2026 03:14
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
# Conflicts: # docs/interactive-runtime.md # docs/tools.md # src/SharpClaw.Code.Agents/Abstractions/IAgentContextManager.cs # src/SharpClaw.Code.Agents/Internal/ProviderBackedAgentKernel.cs # src/SharpClaw.Code.Protocol/Serialization/ProtocolJsonContext.cs # src/SharpClaw.Code.Runtime/Composition/RuntimeServiceCollectionExtensions.cs # src/SharpClaw.Code.Runtime/Configuration/AutomaticCompactionOptions.cs # src/SharpClaw.Code.Runtime/Context/AutomaticContextManager.cs # tests/SharpClaw.Code.IntegrationTests/Runtime/InteractiveMilestoneTests.cs # tests/SharpClaw.Code.UnitTests/Runtime/AutomaticContextManagerTests.cs
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
Large tool responses now keep a bounded head/tail preview in model context while preserving complete tool results, events, and immutable session artifacts. The permission-aware
read_tool_outputtool retrieves those artifacts in bounded Unicode-safe windows. Storage is partitioned by tenant and session, and retrieval accounts for JSON escaping to avoid recursively archiving oversized pages.Oversized histories compact through bounded summarization calls that carry validated working state forward. Only the completed replacement is persisted; cancellation, invalid later chunks, and call-limit failures never publish partial state. Explicit provider context overflow permits one forced-compaction recovery per agent invocation, with fresh stream buffers and no replay of already executed tools.
Stacked on #51. The base is intentionally
codex/snapshot-compaction-live-controlso this PR shows only the resilience milestone. Retarget tomainafter #51 merges.Validation
dotnet build SharpClawCode.sln --configuration Release --warnaserror --no-restore— zero warnings/errorsdotnet test SharpClawCode.sln --configuration Release --no-build --no-restore— 469 passed: 318 unit, 131 integration, 20 parityRisk and compatibility
ContextWindowExceededenum value are additive; existing enum values retain their ordinalsToken budgets remain estimates. Preview limits bound model input, not process memory or artifact/event disk usage. Artifacts follow session-storage lifetime without independent automatic deletion. Irreducible context and failed maintenance stop explicitly. Local verification ran on macOS; cross-platform CI is pending.