feat: implement Crosscheck Work experiment

Add the 'Crosscheck Work' experiment to the Agents settings. When enabled,
a reviewer sub-agent is spawned after the main agent finishes a turn (with
no pending tool calls). The reviewer critiques the output using a dedicated
system prompt focused on correctness, simplicity, and code quality. If the
reviewer does not respond with 'LGTM!', its feedback is injected as a
synthetic user query back to the main agent, which must address it. This
loop continues until the reviewer approves or max iterations is reached.

Components:
- Feature flag: CrosscheckWork (enabled in DOGFOOD_FLAGS)
- Settings: agents.experiments.crosscheck_enabled,
  agents.experiments.crosscheck_model_id,
  agents.experiments.crosscheck_max_iterations
- Settings UI: new 'Experiments' subpage under Agents
- Crosscheck module: app/src/ai/crosscheck/ with prompt, reviewer model
- Controller integration: hooks into AfterStreamFinished when no actions
  are queued, triggers reviewer, handles feedback injection
- Provider support: OpenAI-compatible and Bedrock direct invocation
- Safety: max iteration guard, error handling, reset on new user query
This commit is contained in:
Ryan Ward
2026-07-22 15:58:55 -05:00
parent ca2cf6f8d6
commit e5062ae432
9 changed files with 912 additions and 7 deletions
+4
View File
@@ -272,6 +272,7 @@ pub enum SettingsSection {
ThirdPartyCLIAgents,
Bedrock,
OpenAI,
Experiments,
/// Internal backing-page identifier for CodeSettingsPageView. Multiple subpages
/// (CodeIndexing, EditorAndCodeReview) share this single backing page,
/// so this variant is needed as the key in `settings_pages`.
@@ -306,6 +307,7 @@ impl Display for SettingsSection {
SettingsSection::ThirdPartyCLIAgents => write!(f, "Third party CLI agents"),
SettingsSection::Bedrock => write!(f, "AWS Bedrock"),
SettingsSection::OpenAI => write!(f, "OpenAI / LiteLLM"),
SettingsSection::Experiments => write!(f, "Experiments"),
SettingsSection::Warpify => write!(f, "Wormhole"),
SettingsSection::CodeIndexing => write!(f, "Indexing and projects"),
SettingsSection::EditorAndCodeReview => write!(f, "Editor and Code Review"),
@@ -363,6 +365,7 @@ impl SettingsSection {
Self::ThirdPartyCLIAgents,
Self::Bedrock,
Self::OpenAI,
Self::Experiments,
]
}
@@ -405,6 +408,7 @@ impl FromStr for SettingsSection {
"CloudEnvironments" | "Environments" => Ok(Self::CloudEnvironments),
"OzCloudAPIKeys" => Ok(Self::OzCloudAPIKeys),
"SharedBlocks" | "Shared Blocks" => Ok(Self::SharedBlocks),
"Experiments" => Ok(Self::Experiments),
_ => Err(()),
}
}