Repository navigation
feat(agents): agent-controlled session status, attention, and TTL in the sessions tool - #111583
Conversation
…the sessions tool
|
Codex review: needs real behavior proof before merge. Reviewed July 19, 2026, 11:57 PM ET / July 20, 2026, 03:57 UTC. Summary PR surface: Source +358, Tests +185, Docs 0, Other +12. Total +555 across 34 files. Reproducibility: no. the PR describes a concrete live-gateway path, but its own evidence says that run was not completed. A high-confidence reproduction/proof is to have an agent call sessions.patch, observe the sidebar, then verify clear-on-read, clear-on-next-human-message, and TTL expiry. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep one additive agent-status contract in the existing sessions tool and gateway projection, then land it only after a maintainer confirms the product semantics and a real gateway run proves declaration, read/reply clearing, and TTL expiry. Do we have a high-confidence way to reproduce the issue? No; the PR describes a concrete live-gateway path, but its own evidence says that run was not completed. A high-confidence reproduction/proof is to have an agent call sessions.patch, observe the sidebar, then verify clear-on-read, clear-on-next-human-message, and TTL expiry. Is this the best way to solve the issue? Unclear; the patch uses the existing attention and subtitle architecture, which is the narrowest apparent implementation path, but maintainers must first confirm that these three model-facing persisted-state fields are the desired permanent contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 503b21dc6bfd. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +358, Tests +185, Docs 0, Other +12. Total +555 across 34 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles) |
…nexport internal cap
|
Merged via squash.
|
…the sessions tool (openclaw#111583) * feat(agents): agent-controlled session status, attention, and TTL in the sessions tool * feat(protocol): sessions.patch agent status fields and curated attention icon ids * chore(protocol): regenerate bindings for agent-status patch fields, unexport internal cap * chore(sessions): unexport internal agent-status TTL default
|
Live model verification (post-land, dev gateway on current main): GPT-5.6 Luna, prompted only in natural language, performed exactly one |
What Problem This Solves
Agents can already draw their session icon and archive/pin/rename via the
sessionstool, but they cannot tell the user "I'm blocked, I need you" through the sidebar, and they cannot set a transient status line. When an agent needs a password, a review, or any input, the session row looks idle. Follow-up to the automatic attention states (#111035) — this adds the agent-declared layer discussed with the maintainer.Why This Change Was Made
Product premise: the agent controls its environment. The model is not prompted toward these actions; they exist in the tool schema for when the agent is blocked or the user asks.
User Impact
The existing
sessionstoolpatchaction gains three model-facing fields (discovery confirmed title/icon/pin/archive already existed; a label-clear schema mismatch was fixed):statusNote(≤120 chars, sanitized likelastRunError): a transient sidebar status line for the session. Renders in the subtitle slot with priority automatic attention > agent status > live narration (feat(ui): live agent activity subtitles on running sidebar sessions #111221) > work subtitle.attention:clear | hand | key | alert | flag | lock | hourglass— curated icons from the session-icon registry; requires an activestatusNote; amber accent; participates in child bubbling, the 4-child cap bypass, and collapsed-section dots exactly like automatic attention.ttlMinutes(default 30, max 120): the declaration self-clears server-side. It also clears when the user reads/opens the session (thelastReadAtmarker), when the next human message arrives at any entry point (gateway, channel, fast-path, command sessions), or when the agent clears it explicitly. Lifecycle-only writes never erase a status set during the same run.agentStatusobject on the session entry (no schema-version change, plugin slot key reserved); expired declarations are suppressed during row projection; session events emit explicitnullon clear so clients discard stale state. The sidebar also schedules a local invalidation at the server-issued expiry so an idle UI drops expired status without another event.chat-thread.ts(item.messagewas cast without theasRecordguard its sibling uses; a message-less chat event crashed the event listener — found while live-testing this feature).docs/web/control-ui.mddocuments the behavior.Evidence
sessions-toolschema/executor tests 12 pass (including the model-schema contract test); gateway batch (sessions-patch, session-utils, agent-session-patch) 213 pass; full UI project 4576 pass; focused sidebar suite green post-rebase over feat(ui): live agent activity subtitles on running sidebar sessions #111221 (agent status threaded through the narration-era subtitle resolver with an explicit priority test).node scripts/run-tsgo.mjs(core, core-test, ui, ui-test).