← Back to Pull requests

Agent screens: a card stays answerable when a new turn starts #590

Closed
unknown closed this pull request without merging on Nov 29, 2026 04:32 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 01:33 UTC
Author

Requested by the owner. The plugin side is Giton22/hermes-herald-push#9 (0.7.1), which already takes a late tap as the user's next message, so no plugin change is needed.

What changes

A card nothing waits on stays answerable. The newest screen takes a tap, sent as the user's next message, until:

  • it was answered (one tap per card, as before);

  • the user sent something of their own after it (any ChatMessage.User: typed, voice, a suggested reply, a steer, a tap on another card, from any device);

  • a newer screen replaces it (a new surface in a later call; an in-place update to the same surface keeps it the same card);

  • it's old history: its row is archived by a compression (active: false / compacted), stored under an ancestor session, or behind a compaction checkpoint. /new opens a new chat, or compresses a bot's.
  • Turns the user didn't start don't close it. hermes-agent stores those as user rows with their own kinds, and Kyllene already shows them as something other than a prompt. A scheduled job's message is a Routine event. A subagent's report is a stored notice, and a background process is a Process event. auto_continue (tui_gateway/session_auto_continue.py) is a label. A plugin's inject_message is an internal event, stored as internal_notification (gateway/response_filters.py display_kind_for_event). The agent still streaming doesn't close it either. A late tap goes through sendPrompt, so while a turn runs it follows the "While a reply is running" setting: steer, or queue in place of Stop and send.

    A card answered after more came in says "Asked earlier: a tap still answers in the chat".

    A locked card looks locked (reporter's case 1). On Android a screen that takes no taps draws with a quieted Material scheme: primary and secondary take the quiet fill, and the agent's primaryColor is dropped. On desktop the inert card is greyed after 250 ms, so the brief inert state during each redraw doesn't flicker.

    The "Opening…" gap (reporter's case 2). A tap while a waiting card is drawn but its call isn't waiting on the phone yet is kept (one per card). The card says "Got your answer: it goes once the screen opens" and hands the tap to the call once it waits. If the call ends without waiting (not shown within 15 s, stopped, failed), the tap is sent as the next message instead.

    Why the request lags the drawing: the card is drawn from the chat's tool.start event, but the call reaches the phone separately. The plugin writes a request file. Kyllene learns of it from the tool event, a push or a reconnect, and reads it with /herald-push phone pending. ShowUiTool then waits up to 1 s for the transcript call to match (awaitScreenPlacement), checks the screen draws (agentScreenProblem, on IO), and only then registers the wait, which makes the card live.

    Desktop works the same way: the shared AgentScreenCard and ScreenViews run there too. Plugin (standalone gateway) cards keep their behaviour and only get the quiet look once read-only. A card a call waits on behaves as before.

    No new gateway calls. The support window (v0.22.0 to v0.23.4) is unchanged.

    Tests


  • ScreenViewsTest: the card stays open after a scheduled job's message, after a subagent, /bg or process result, while the reply streams, and after the agent's own follow-up. It closes after the user's own message (sent, pending or queued), when a newer screen replaces it (an in-place update doesn't), and in old history or after a compaction.

  • AgentScreenTest.aCallTheLiveAgentNoLongerHoldsIsEarlier: stored calls from an ancestor session or an archived row are marked earlier.

  • AgentScreenLateTapTest (desktop compose): a tap while opening reaches the call once it waits; a held tap for a call that never waited goes as the next message; a closed card takes no taps and an open one sends once.

  • AgentScreenQuietTest, AgentCardStyleTest: the locked look.
  • On master these fail. The opening case's takesTaps stays false, so the tap can't be made, and ScreenViews had no rule beyond "last finished reply".

    CI's command passes locally. The only failures were two DesktopPdfTest cases that time out under a loaded machine; they pass when run alone.

    On a device


    Emulator, Dev build, 360 dp, against a throwaway Hermes Agent v0.23.4 gateway with herald-push 0.7.2 and a fake model that calls phone_show_ui (tool search off, so the phone tools are offered directly).

    A card nothing waits on (wait: false) stays open after a /bg result and after two scheduled job runs; a tap goes as the next message, then the card locks.

    | After /bg (light) | After a scheduled job (light) | Tap sent (light) |
    |---|---|---|
    | <img src="https://raw.githubusercontent.com/Giton22/kyllene/ae305fd90447cff8f37f7ac26ea4318579514384/1-light-open-after-bg.png" width="240"> | <img src="https://raw.githubusercontent.com/Giton22/kyllene/ae305fd90447cff8f37f7ac26ea4318579514384/2-light-open-after-scheduled.png" width="240"> | <img src="https://raw.githubusercontent.com/Giton22/kyllene/ae305fd90447cff8f37f7ac26ea4318579514384/3-light-tap-sent.png" width="240"> |

    A locked card looks locked: no accent, quiet buttons, no note.

    | Locked (light) | Locked (dark) |
    |---|---|
    | <img src="https://raw.githubusercontent.com/Giton22/kyllene/ae305fd90447cff8f37f7ac26ea4318579514384/4-light-locked-after-answer.png" width="240"> | <img src="https://raw.githubusercontent.com/Giton22/kyllene/ae305fd90447cff8f37f7ac26ea4318579514384/5-dark-locked-after-answer.png" width="240"> |

    A tap during "Opening…" (wait: true) is kept and lands once the request arrives. Frames from a screen recording, about 1/8 s apart: Opening…, then the tap on Salad is kept ("Got your answer: it goes once the screen opens"), then the call registers and returns {"event":"salad",…}, and the agent carries on. On this test setup the gap is under a second; over a slower link, or when the request comes by push or a reconnect, it is longer (see why the request lags, above).

    <img src="https://raw.githubusercontent.com/Giton22/kyllene/ae305fd90447cff8f37f7ac26ea4318579514384/7-dark-tap-while-opening.png" width="960">

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Giton22 Review duration: 178m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #590"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 22.5% · Safe to merge
    22.5%