Skip to content

Sensing in the Character Prompt: one dense, lossy situation line #1373

Closed

Description

@omesser

Parent: #144 (item 2). Accepted for V1 in the verdict.

Why

Ambient and reactive wakes should land on what the user is actually doing. That is what makes an authored personality feel alive instead of filling silence. Today follow_up (crates/core/src/director/prompt.rs) already sends time:, state:, standing on: and the frontmost application (open:), one labelled line each. It sends no history of recent apps, no durations, no window titles and nothing from Memory. That detail sits behind list_windows, describe_screen and recall, which only a Harness can call.

Proposal

Replace the separate time: and open: lines with one dense line of roughly 40–60 tokens:

now Tue 14:52 · front VS Code "main.rs — fidget" 41m · before Chrome "PR #1354", iTerm2 "cargo test" 3m · on Slack · idle 0m · mem: prefers terminal late
Field Content
now weekday and local clock
front frontmost app, its title, minutes in front
before up to 3 recent front apps, newest first, title when allowed, minutes
on what the feet stand on (today's standing)
idle minutes of user idle
mem up to 2 Memory lines (shape decided by the Memory spec, item 3; omitted until then)

Rules

  • Lossy is intended. It's a hint, not a record. A Harness can still call list_windows / describe_screen / recall for detail, and a Model API Director gets enough to say something specific.
  • Titles are truncated (about 24 characters, cut on a char boundary). Durations are in whole minutes. At most 3 recent apps and 2 Memory lines.
  • Gates. The frontmost app name stays Free tier, as open: is today. Titles, and the names of apps other than the frontmost, need the Window and application names consent (CapabilityId::WindowNames). The DenyList filters every window before anything enters the line, using the same filter as list_windows / describe_screen.
  • Omit, don't placeholder. A field whose consent is off or whose value is empty is left out entirely.
  • Untrusted text. Titles come from other apps. Strip newlines and the · separator so a title can't forge another field or a labelled line.

Seams

  • Activity (crates/core/src/sensing.rs) holds only the frontmost app, switched, idle and the clock. It needs a small ring of recent front apps with entered-at times, kept on the Shell side.
  • follow_up builds the line, and character_prompt reuses it, so the opening turn and later turns agree.
  • DenyList in crates/core/src/tools.rs.

Done when

  • One line replaces time: / open: in follow_up, and stays within the token budget on a fixture with every field filled.
  • With window-names consent off, no titles and no names of non-front apps appear. Denylisted apps never appear.
  • A small local model still answers the reply contract with the line present.

— Cursor agent (Architect), on @omesser's behalf.

Activity

  1. added this to the V1 milestone on Oct 6, 2026
  2. added
    enhancementNew feature or request
    needs-triageMaintainer needs to evaluate this issue
    p1Next up: the default for work that should happen
    promptingLLM prompting facilities, shape and contents
    on Oct 6, 2026
  3. omesser commented on Oct 6, 2026

    @omesser
    OwnerAuthor

    Two corrections before implementing, agreed with @omesser:

    Gate. The frontmost app name is not Free tier. ADR-0032 put application names behind the Window and application names consent, and withhold_frontmost_name (src-tauri/src/frame_loop.rs) already drops it when that consent is off or the app is excluded. So every named field (front, before, the title) needs the consent; without it the block keeps time, standing on and idle.

    Format. Labelled lines, not one ·-joined line. The saving comes from dropping prose and being lossy, not from the separator: a newline is one token and · is one or two. It matches every other fact in follow_up, and title sanitizing is just newlines and ".

    time: Tue 14:52
    front: VS Code "main.rs — fidget" 41m
    before: Chrome 12m, iTerm2 3m
    idle: 0m
    

    before carries names and minutes only; the title is the front app's alone. standing on: stays as it is. mem: waits for #1374.

    — Claude Code agent

  4. added a commit that references this issue on Oct 6, 2026
    57bc8b4
  5. omesser commented on Oct 6, 2026

    @omesser
    OwnerAuthor

    Shipped in #1377 (merge fefedcba, on main).

    What landed, per the Done-when and the agreed corrections above:

    • follow_up now sends the desktop as short labelled lines (time: with weekday, front: with app, title and minutes, before: with up to 3 earlier front apps and minutes, idle: from one minute up) in place of time: / open:. Empty lines are left out. A test pins the fully filled block at 240 bytes (about 60 tokens).
    • Every name, including the front app, needs the window-names consent (ADR-0032). before is filtered against that consent and the exclusion list, and the title is looked up only for a front name that passed. Titles are cut at 24 characters and scrubbed of control characters, other line separators and ", so a title can't forge a line.
    • Small-model check: llama3.2:1b answered with a declared Behavior 8 of 8 times with the block present.

    Still open: the mem: line, which waits on the Memory spec in #1374. That's tracked there, so closing this one as completed.

    — Cursor agent (Coder), on @omesser's behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds-triageMaintainer needs to evaluate this issuep1Next up: the default for work that should happenpromptingLLM prompting facilities, shape and contents

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions