Repository navigation
fix(agent,event-log): recover context overflow, allow concurrent project registration, and add opt-in host stress tests - #7083
Merged
Conversation
…ect registration, and add opt-in host stress tests
UncertaintyDeterminesYou4ndMe
added a commit
that referenced
this pull request
Nov 20, 2026
A main-model reply that stops at the output length limit goes back to the model: a cut-off reply gets a continue cue, a cut-off tool call a rejection, and a reply cut off while only reasoning a note asking for a shorter answer. The Run counts these stops in agent_runs.output_limit_stops (migration 50) and fails after the fourth, so the cap holds however the frontier is replayed. An Anthropic stream that stops with model_context_window_exceeded is a provider error, so the context-overflow recovery from #7083 takes over instead of the turn ending as a normal finish. Generated-by: Claude Code (Claude Opus 5.5)
UncertaintyDeterminesYou4ndMe
added a commit
that referenced
this pull request
Nov 20, 2026
…l output Since #7083 a main-model context overflow interrupts the attempt. When the attempt's partial output never reached the canonical log (no semantic output, no tool calls), the overflow is now compacted like a no-output overflow instead of failing the turn, so the dropped text cannot come back in a later replay. On OpenAI Responses an overflow after an accepted output item still ends the turn. The continuation tells the model its previous reply was cut off, whether the overflow adopted a ready background summary or produced its own. Generated-by: Claude Code (Claude Opus 5.5)
This was referenced Nov 20, 2026
M4n5ter
pushed a commit
that referenced
this pull request
Nov 20, 2026
…l output Since #7083 a main-model context overflow interrupts the attempt. When the attempt's partial output never reached the canonical log (no semantic output, no tool calls), compact and continue instead of failing the turn: - Consolidate the safe-overflow check in Attempt::compactable_overflow() across state, engine, and native; OpenAI Responses attempts that already persisted semantic output or tool calls still end the turn. - Reject unadmitted tool calls from ContextOverflow attempts (and wait for Assess while an interrupted attempt has no recovery yet) so doomed overflowed attempts never execute side-effecting tools before failing. - Emit the Host cut-off note on both on-demand overflow summaries and adopted background proactive summaries (Action::AdoptCandidate). - Route Anthropic stream model_context_window_exceeded to ProviderError so it takes the ContextOverflow compaction path instead of output-length continuation.
M4n5ter
pushed a commit
that referenced
this pull request
Nov 20, 2026
…l output (#7055) Since #7083 a main-model context overflow interrupts the attempt. When the attempt's partial output never reached the canonical log (no semantic output, no tool calls), compact and continue instead of failing the turn: - Consolidate the safe-overflow check in Attempt::compactable_overflow() across state, engine, and native; OpenAI Responses attempts that already persisted semantic output or tool calls still end the turn. - Reject unadmitted tool calls from ContextOverflow attempts (and wait for Assess while an interrupted attempt has no recovery yet) so doomed overflowed attempts never execute side-effecting tools before failing. - Emit the Host cut-off note on both on-demand overflow summaries and adopted background proactive summaries (Action::AdoptCandidate). - Route Anthropic stream model_context_window_exceeded to ProviderError so it takes the ContextOverflow compaction path instead of output-length continuation.
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
Two real Maka Host bugs uncovered under high-concurrency / long-session stress testing, plus five opt-in (
#[ignore]) real-Host stress scenarios covering JS V8 Code Mode, Python Monty Code Mode, 60-session chaos/steering/cancel storms, 40-turn cascading compaction + overflow recovery, and adversarial OOM/kill/reopen storms.Bug Fixes
plugins/agent/native/src/owner/driver_model.rs(P0 —ContextOverflowpermanently wedged runs inrunning):ModelError::ContextOverflowfromterminal_outcomewhenpurpose == ModelPurpose::Mainso the model attempt interrupts instead of closing withOutcome::Error, letting the engine enterAssessModel -> AttemptRecovery::ContextOverflow -> Preparation::ContextOverflowemergency compaction.ModelPurpose::Summaryclosing withOutcome::ErrorsoCompactionFallbackcontinues to work.witness.recovery(...)forModelError::ContextOverflowto avoidInvalidTransition("context overflow requires an original interrupted model attempt").context_overflow_terminal_outcome_interrupts_main_and_closes_summary.platform/event-log/src/projects/mutation.rs(P1 — concurrentSessionCreatespuriously rejected withworkspace_unavailable):RegistrationGuard::ObservedAvailablepreviously compared fullProjectRecordequality (actual != expected), causing concurrent directorySessionCreatecalls to fail withProjectError::Changedwhenever another session bumpedprojects.last_used_at.prepare_project_selection: match on(id, identity)and reject only if archived or identity changed.concurrent_available_registration_ignores_last_used_at_bump_but_rejects_archive.Opt-in (
#[ignore]) Real-Host Stress ScenariosAdded in
products/maka/cli/tests/mainline_reopen/host_nightmare_stress.rs(all#[ignore], never executed in defaultcargo test):real_host_codemode_v8_and_subagent_fanout_storm(10 JS V8 parents × 2 JS V8 children = 30 concurrent sessions)real_host_codemode_python_and_subagent_fanout_storm(10 Python Monty parents × 2 Python Monty children = 30 concurrent sessions)real_host_60_session_incident_wave_and_steering_cancel_storm(60 mixed-protocol concurrent sessions + repeating fault waves + mid-stream steering + mid-run stop & restart)real_host_40_turn_multi_compaction_and_overflow_torture(40 turns, 13 cascading compactions, 2 live HTTP 400context_length_exceededrecoveries, 2FinishReason::Lengthtruncations)real_host_codemode_js_and_python_adversarial_kill_oom_reopen_storm(12 simultaneous JS+Python sessions across OOM bombs,agent.stop,wait(terminate=true), follow-up turns, and full Host quit/reopen)Verification
cargo fmt --checknode scripts/asf-license-headers.mjs checkcargo clippy --no-deps -p maka-cli --test mainline_reopen -- -D warningscargo test -p maka-event-log(40/40 passed)cargo test -p maka-agent-native context_overflow_terminal_outcome(1/1 passed)host_nightmare_stressscenarios executed live against real Maka Host and passed with 0 watchdog violations, 0 FD leaks, and 0 leaked Monty worker processes.