Synced from monorepo

Changes:
- Gate session-lifecycle heap steady state with a dhat soak
- Unbreak merge lifecycle e2e after default model → grok-4.5
- Scan home-scope rules dirs at <root>/rules
- Complete text-input paste and terminal parity
- Gate project roles and personas
- Use canonical editing in dialogs
- Use canonical editing in search bars
- Reject ambiguous MCP tool IDs
- Harden Git operands for plugins
- Simplify queue drain API
- Pass RFC 9207 iss through MCP OAuth token exchange
- Show leader roster when local agents map is empty
- Use canonical editing in Persona views
- Remove marketplace default-skills auto-install and purge old installs
- Use canonical editing in extension forms
- Add canonical dashboard text editing
- Use canonical editing in settings
- Add /summarize as a /recap alias
- Restore previous agent when exiting dashboard
- Use tool_choice auto for compaction
- Settings toggle for snap-prompt-to-top on send
- Update default models to grok-4.5
- Source login shell once for local bash (env + alias/function snapshot)
- Template hardcoded param names in server-native tool descriptions
- Fix System-Reminder XML tag injection in CLAUDE.md via agents_md
- Fix remote workspace-server hardcoding LSP trust (repo code execution risk)
- Clear orphaned tool-call updates at turn end
- Suppress task wake after cancel
- Send x-grok-client-identifier on direct API tool calls
- Harden dashboard peek lease transitions
- Host /btw side panel in live region (minimal mode)
- Bound scroll presentation latency
- Highlight multi-line constructs correctly in diffs and the file viewer
- Block web_fetch non-public IPs; local opt-in is explicit-host only
- Seed coding_data_retention_opt_out=false for OAuth e2es in pty-harness
- Follow up clipboard delivery feedback
- Use canonical editing in pickers
- Route TextArea through canonical editor
- Persistent "watching" status row; quieter turn markers
- Gate sensitive edit targets
- Expose agent registry counts and gate session churn on them
- Default coding data sharing to opt-out until server preference applies
- Wire chat attachment ids through gateway prompts
- On auth refresh failure, issue retry
- Forward preview provenance and computer lifecycle state
- Document independent privacy controls and scope /privacy output
- Strip SamplingError Display prefix on rate-limit UI copy
- Stop dumping Cloudflare HTML into Retry failed
- Disable in-place prompt edit (scroll jank on enter)
- Strip forced ANSI color from gh pr view JSON
- Plumb bash tool description onto ToolUsageCard wire
This commit is contained in:
grokkybara[bot] 2026-07-18 19:48:28 +01:00
commit 7cfcb20d2b
292 changed files with 23315 additions and 9209 deletions

View file

@ -10,7 +10,7 @@
//!
use super::commands::{
ParsedPromptInfo, PromptCompletionKind, PromptTurnOk, PromptTurnResult, SessionCommand,
ok_end_turn,
TaskWakeAdmission, TaskWakeFallback, ok_end_turn,
};
use super::handle::SessionHandle;
use super::notifications::NotificationSender;
@ -196,6 +196,9 @@ pub(crate) struct InputItem {
pub(crate) json_schema: Option<serde_json::Value>,
/// Who originated this prompt — user or auto-wake system.
pub(crate) origin: super::PromptOrigin,
/// Typed deferred completion retained while an admitted task wake is queued.
/// Consumed by Ctrl+C if it removes the wake before the turn starts.
pub(crate) task_wake_fallback: Option<TaskWakeFallback>,
pub(crate) respond_to: oneshot::Sender<PromptTurnResult>,
/// Fired after the user message is in chat history and a persistence flush
/// barrier has completed (see `SessionCommand::Prompt::persist_ack`).
@ -271,8 +274,8 @@ pub(crate) struct State {
pub(crate) running_task: Option<AgentTask>,
pub(crate) pending_inputs: VecDeque<InputItem>,
pub(crate) pending_notifications: Vec<PendingNotification>,
/// When true, notifications are buffered but not drained until the next
/// user-initiated prompt arrives. Set on cancel, cleared on user Prompt.
/// When true, notifications are buffered but not drained until genuine
/// user re-engagement. Set by interactive Ctrl+C, cleared by a user prompt.
pub(crate) notifications_suppressed: bool,
/// Active prompt is still rewindable until the first outbound prompt-scoped
/// event is emitted.
@ -300,13 +303,13 @@ impl State {
}
/// Sweep `pending_inputs`, removing entries matching `drop_if` EXCEPT the
/// running turn's own slot, and return the removed items (callers harvest
/// them for telemetry counts / `auto_wake_delivered` un-marks).
/// them for telemetry counts / reservation releases).
///
/// Returned items still carry live `respond_to` senders that this helper
/// does NOT resolve — dropping them unfulfilled is correct only for
/// synthetic items (no client RPC awaits them, the current callers); a
/// caller whose predicate can match user-originated items must resolve
/// each returned item (see `respond_removed_queued_prompt`) or the
/// each returned item (see `respond_removed_prompt`) or the
/// client's `session/prompt` hangs and fails spuriously.
///
/// The guard is the safety invariant every sweep must inherit: the
@ -343,7 +346,8 @@ impl State {
/// so they share one definition of idleness, with no drift between them.
///
/// Returns `true` exactly when: no turn is running, no user prompt is
/// queued, and notifications haven't been suppressed by a cancel.
/// queued, and interactive Ctrl+C has not suppressed notifications pending
/// genuine user re-engagement.
pub(crate) fn is_session_idle_for_injection(state: &State) -> bool {
state.running_task.is_none()
&& state.pending_inputs.is_empty()