← Back to Pull requests

feat(agent): scrollable AgentPlan, live progress prose, multi-term/ID shelf filters, and token usage (#435) #436

Closed
unknown closed this pull request without merging on Dec 03, 2026 02:52 UTC
View on GitHub
unknown unknown commented on Dec 02, 2026 23:46 UTC
Author

Closes #435

Summary

  • Scrollable AgentPlan & bounded step trace: Bound .ui-agent-plan (max-height: min(45vh, 24rem); overflow-y: auto; flex-shrink: 0) and .ui-agent-plan-trace (max-height: 12rem; overflow-y: auto) in src/index.css so expanded multi-step runs stay scrollable without pushing the bookmark shelf or action controls off-screen.

  • Live agent prose, step details, maxSteps notice, & completion toasts: Capture onStepFinish step text and cumulative token usage in src/llm/agentRunner.js (forwarded from src/llm/index.js and src/hooks/useAgentEngine.js), stream interim prose inline inside AgentPlan, render concise step argument/match summaries (formatStepDetail in src/utils/agentSteps.js), detect maxSteps exhaustion with no final reply, and emit a toast on multi-step completion or step-limit halt.

  • Declarative multi-term OR, exclusion, & explicit ID shelf filtering (Chrome MV3 CSP-safe): Extract shared schema definitions (src/tools/capabilities/filterSchema.js) and add anyQueries, excludeQueries, includeAnyTags, and ids (+ label) across src/utils/bookmarkFilters.js, bookmarks_search (src/tools/capabilities/collectionRead.js), view_set_agent_filter (src/tools/capabilities/uiFilters.js), and buildAgentSystemPrompt (src/tools/agentProfiles.js) so broad topic queries ("show me all music, concert, or instrument bookmarks") apply directly to the visible shelf in 1–2 tool calls without looping or executing runtime eval. Each search-family filter occupies its own slot so combined constraints intersect cleanly.

  • Per-run & cumulative session token counter: Track and display per-run token usage alongside cumulative session tokens in AgentPlan header badges (with input/output/session tooltip breakdown) across normal, superseded, error, and aborted runs.
  • Verification

  • npm run format && npm run ci passed locally (Test Files 144 passed (144), Tests 1758 passed (1758), Prettier check, ESLint, Chrome build, check-chunk-laziness.mjs, and Storybook build).

  • Pre-push security and code-quality review (claude -p --model sonnet) returned APPROVED with zero P0/P1/P2 findings.
  • <!-- agent-bot-write: ghw_e3e6979936fe45d4 session=210bdd5e08f0 bot=trueline-antigravity-agent[bot] conversation_id=e99b26b3-53f9-4d7f-8337-fb33257bb240 conversation_id_source=self-reported -->

    Diff: 298 lines (+223 / -75) across 3 files Reviewer: qwts Review duration: 185m
    All Vouch review confidence checks passed
    Residual risk 0.29 = Change Risk (0.68) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.68 · 298 lines diff across 3 files
    0.68
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.341
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.068
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #436"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 68.2% (HIGH) · Higher = larger blast radius
    68.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.5% · Safe to merge
    29.5%