GPUI Box GitHub

Components / agent

AgentRunIssues builder

A single truthful notice for malformed multi-agent snapshot structure.

A builder is RenderOnce. Construct and mount it in one expression.

use gpui_kit::agent::AgentRunIssues;

Reviewed in agent-run-issues.

Construct
new(ident: impl Into<Ident>, issues: impl IntoIterator<Item = AgentModelIssue>) -> Self
from_run(ident: impl Into<Ident>, run: &AgentRunSnapshot) -> Self
Example · agent-run-issues
fn agent_run_issues(_window: &mut Window, cx: &mut App) -> AnyElement {
    let theme = cx.theme().clone();
    // Deliberately broken: the root names an agent that is not in the list,
    // one agent is listed twice, a task is owned by nobody, and a link ends
    // at an agent that does not exist.
    let malformed = AgentRunSnapshot::new("release-review", "missing-coordinator")
        .execution(AgentExecutionState::Active(AgentActivity::Aggregating))
        .agents([
            AgentSnapshot::new(AgentDescriptor::new("researcher", "Nova"))
                .presence(AgentPresence::Online),
            AgentSnapshot::new(AgentDescriptor::new("researcher", "Nova"))
                .presence(AgentPresence::Online),
        ])
        .tasks([AgentTaskSnapshot::new("review", "Review").owner("reviewer")])
        .links([RunLink::new(
            "spawn-verifier",
            RunSubjectId::Agent("researcher".into()),
            RunSubjectId::Agent("verifier".into()),
            RunLinkKind::Spawn,
        )]);

    stack(&theme)
        .w(px(560.0))
        .child(caption(
            &theme,
            "A snapshot the host sent that does not describe a run",
        ))
        .child(AgentRunIssues::from_run(
            "scene.agent-run-issues.notice",
            &malformed,
        ))
        .child(caption(
            &theme,
            "A well-formed snapshot, where the component draws nothing at all",
        ))
        .child(AgentRunIssues::from_run(
            "scene.agent-run-issues.silent",
            &scene_agent_run(),
        ))
        .into_any_element()
}

Source: crates/gpui-kit/src/agent/presentation.rs