chore: sync reviewed upstream changes (batch 2) - #61
Merged
Conversation
…imental-cli-composition feat(coding-agent): compose experimental CLI commands Upstream-Commit: 35fe555
Upstream-Commit: 4f4762f
…ion (earendil-works#7370) * fix(coding-agent): preserve agent events during compaction Manual compaction already waits for the active agent run to settle, and summary generation does not emit Agent events. Keep the agent subscription connected so unexpected concurrent events are not dropped, and remove the obsolete reconnect helper. closes earendil-works#7253 Upstream-Commit: e56893f
…l-works#7540) * fix(coding-agent): resume after context-limited length stops Treat length stops as context overflow when prompt usage is within 1% of Pi's configured context window. Include cache-write tokens in that usage and allow non-zero output because OpenAI may emit reasoning tokens before returning an incomplete response. After compaction, remove any retryable error or truncated-length assistant message restored from persisted session history so the interrupted agent turn can continue. This is specifically for handling this case for openai models: https://developers.openai.com/api/docs/guides/reasoning > If the generated tokens reach the context window limit or the max_output_tokens value you’ve set, you’ll receive a response with a status of incomplete and incomplete_details with reason set to max_output_tokens. This might occur before any visible output tokens are produced, meaning you could incur costs for input and reasoning tokens without receiving a visible response. This detection currently assumes the reported prompt usage is within 1% of the context window configured in Pi. Its reliability therefore depends on Pi's model contextWindow metadata matching the provider's effective limit. Maybe we should consider treating OpenAI incomplete responses as requiring compaction regardless of the local context-window estimate? fixes earendil-works#7020 * fix(coding-agent): recover truncated responses after compaction Classify length stops by comparing provider-reported output usage with the model's intended output limit. Compact and retry once when generation ends below that limit, avoiding unreliable context-window estimates while preserving genuine max-output stops. Normalize OpenAI Responses incomplete reasons so only max_output_tokens is treated as a length stop. Preserve qualified provider reasons for diagnostics, surface other reasons as errors, and use neutral truncation wording in the TUI. Upstream-Commit: 32850ef
…7394) Fixes earendil-works#7290 Co-authored-by: Mario Zechner <badlogicgames@gmail.com> Upstream-Commit: a447534
CoderDoubleflower
marked this pull request as ready for review
August 5, 2026 03:55
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.
Integrate the second reviewed upstream batch from
earendil-works/piwith semantic conflict handling.Included upstream changes:
AI_AGENTfor child-process attribution, adapted for pi-claude brandingRequired preservation:
The temporary integration workflow stops at the first conflict and records the exact files for semantic resolution.