Enable DOGFOOD_FLAGS for OSS and add fix-it suggestion for failed commands

Two changes addressing agent context visibility and error recovery:

1. Enable DOGFOOD_FLAGS in oss.rs — this activates AgentViewBlockContext,
   which auto-attaches user-executed command output (stdout/stderr/exit code)
   to the AI conversation context. Previously the LLM was blind to any
   commands the user ran via `!` prefix in agent view.

2. Add instant "Fix this error" prompt suggestion when a user-run command
   fails (non-zero exit) in agent view. This lets users hand off errors to
   the agent with one click instead of manually copy-pasting output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ryan Ward
2026-06-03 01:47:36 -05:00
co-authored by Claude Opus 4.6
parent 9e11c91a6e
commit 17ecf67970
2 changed files with 34 additions and 0 deletions
@@ -304,6 +304,39 @@ impl PassiveSuggestionsModel {
if is_oz_environment_startup_command {
return;
}
// When a user-run command fails in agent view, offer an instant "fix it"
// suggestion so the user can hand off the error to the agent.
if FeatureFlag::AgentViewBlockContext.is_enabled()
&& !block_completed.was_part_of_agent_interaction
&& !block_completed.serialized_block.exit_code.was_successful()
&& !block_completed.command.trim().is_empty()
{
let conversation_id = self
.terminal_model
.lock()
.block_list()
.block_at(block_completed.index)
.and_then(|block| {
block
.agent_view_visibility()
.agent_view_conversation_id()
});
let prompt = format!(
"The command `{}` failed. Diagnose the error and suggest a fix.",
block_completed.command.trim()
);
ctx.emit(PassiveSuggestionsEvent::NewPromptSuggestion {
prompt,
label: Some("Fix this error".to_string()),
request_duration_ms: 0,
trigger: None,
conversation_id,
server_request_token: None,
});
}
let is_prompt_suggestions_enabled = is_prompt_suggestions_enabled(ctx);
let is_passive_code_diffs_enabled = is_passive_code_diffs_enabled(ctx);
if !is_prompt_suggestions_enabled && !is_passive_code_diffs_enabled {
+1
View File
@@ -24,6 +24,7 @@ fn main() -> Result<()> {
mcp_static_config: None,
},
);
state = state.with_additional_features(galaxy_core::features::DOGFOOD_FLAGS);
if cfg!(debug_assertions) {
state = state.with_additional_features(galaxy_core::features::DEBUG_FLAGS);
}