Skip to content

feat: let agents ask without waiting and show their conversations read only - #915

Merged
leynier merged 1 commit into
mainfrom
feat/agent-conversations
Oct 6, 2026
Merged

leynier merged 1 commit into
mainfrom
feat/agent-conversations

Conversation

@leynier

@leynier leynier commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 2 of the inbox: the conversation model also covers messages between agents. Task control stays separate.

  • alera orchestration ask --no-wait: returns the question id at once and keeps the existing routing (a worker's question still goes to its dispatch's coordinator). The answer is pasted on the asker's next turn, or the asker reads it earlier with alera inbox wait --question <id>, which consumes it so it is not pasted again.
  • Read-only conversation view:
    • inbox.conversations and inbox.conversation group status, handoff, merge_ready and decision_gate messages between terminals by thread. A group send is one thread, with a generated id and no root row.
    • Viewing never marks anything read. Lifecycle reports, dispatches and escalations stay out.
    • Both verbs are on the phone allowlist and forwarded to the hub by name.
    • conversationRevision triggers drive a conversationsChanged {revision} event.
    • The CLI gains alera inbox conversations and alera inbox conversation.
  • Retention: agent conversations are deleted after 7 days without activity, unless a message in the thread is still queued or belongs to an unfinished task or dispatch. Inbox expiry and the 20-question pending limit do not apply between agents.

Stacked on the mobile inbox PR.

Validation

  • New tests:
    • conversation_store_tests: grouping, control exclusion, the participant filter, revision scope, and pruning that keeps unread, recent, active-task and control messages.
    • conversation_requests_tests: ask --no-wait plus inbox.wait consuming the answer; the phone reading conversations without consuming them; the event.
    • CLI parsing tests.
  • cargo test -p alera-core --features runtime and cargo test -p alera-cli pass, and clippy is clean.
  • End to end on an isolated runtime, built from this branch, with a terminal in it: ask --no-wait to that terminal, a reply sent with reply --body-stdin from inside it, and inbox wait returned answered. inbox conversations and inbox conversation listed and showed the thread.

Risk

Retention newly deletes old agent conversation rows (read, delivered, expired or obsolete) after 7 days. Previously nothing was pruned.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The reply command pasted into an agent's terminal is a Bash heredoc, so it fails in PowerShell 5.1, cmd, and nushell.

Reviewed changes across the stacked inbox commits on feat/agent-conversations: questions from ext: addresses, the desktop and mobile inbox, and agent-to-agent ask and conversation reads.

  • External inbox. Questions from ext: addresses are stored with expiry, a 20-question pending cap, and 7-day history, and can be asked, answered, and listed from the desktop, the phone, and alera inbox.
  • Ask without waiting. alera orchestration ask --no-wait returns the question id immediately. A worker's question still routes to its dispatch coordinator. alera inbox wait --question consumes the answer so it is not pasted again.
  • Read-only conversations. inbox.conversations and inbox.conversation group agent messages and never mark them read. Idle agent threads are deleted after 7 days unless a row is still queued or tied to an unfinished task or dispatch.

ℹ️ Installed agents still only know blocking ask

Workers follow skills/alera-orchestration, which still documents only blocking alera orchestration ask. --no-wait, inbox wait --question, and the read-only conversation commands are absent, so installed agents will not use this phase unless that skill is updated in the same change.

Technical details
# Document no-wait ask and conversation reads

## Affected sites
- `skills/alera-orchestration/SKILL.md` — still says workers ask through blocking `alera orchestration ask`
- `skills/alera-orchestration/references/worker.md:26` — same contract, no `--no-wait`
- `skills/alera-orchestration/references/messaging.md` — no `inbox wait` or conversation commands

## Required outcome
- A worker can ask without blocking the turn and can read the answer with `alera inbox wait --question` instead of waiting for paste.
- Read-only `alera inbox conversations` / `alera inbox conversation` are documented if agents are expected to use them.

ℹ️ Nitpicks

  • hub_reverse_policy_tests checks the inbox allowlist but omits inbox.conversations and inbox.conversation, so dropping those verbs stays green.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using grok-4.7 | 𝕏

Comment thread rust/alera-cli/src/terminal_host/orchestration/message_formatter.rs Outdated
@leynier
leynier force-pushed the feat/agent-conversations branch from 7f629e8 to 1a0a1bd Compare October 6, 2026 16:17
@leynier
leynier changed the base branch from main to feat/inbox-mobile October 6, 2026 16:17
@leynier
leynier added this pull request to stack #919 October 6, 2026 16:17

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

A follow-up inbox.wait settles on earlier messages in the root thread, so it never parks for that follow-up's answer.

Reviewed changes since the prior review at 7f629e8a3: the conversation commit was rebased onto feat/inbox-mobile and now resolves follow-up waits through the root thread, notifies waiters before paste, and pages conversations by the whole thread.

  • Follow-up wait lookup. inbox.wait on a non-inbox question loads that message's root thread, so a reply stored there can be found.
  • Paste after notify. Send and reply wake parked waiters before injecting, so an answer consumed by inbox.wait or check --wait is not also pasted.
  • Thread-wide listing. Participant and workspace filters match any row in a thread, while order and nextBefore use the thread's latest sequence.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using grok-4.7 | 𝕏

Comment thread rust/alera-cli/src/terminal_host/server/inbox_wait.rs Outdated
@leynier
leynier force-pushed the feat/agent-conversations branch from 1a0a1bd to 2877a96 Compare October 6, 2026 17:03
@leynier
leynier force-pushed the feat/agent-conversations branch from 2877a96 to 6f3199d Compare October 6, 2026 17:15

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes since the prior review at 1a0a1bd6: follow-up waits now ignore earlier messages in the root thread, and the branch was rebased onto the current inbox base.

  • Follow-up wait filter. inbox.wait on an agent question settles only on a reply whose reply_to_id is that question, so an earlier root answer stays unread and the wait stays pending.
  • Regression test. The follow-up test now polls before that reply exists and expects pending, then expects a single answered message.
  • Hub allowlist test. hub_reverse_policy_tests now asserts inbox.conversations and inbox.conversation.
  • Rebase. The branch now sits on feat/inbox-mobile at 0cd515e8, which already uses a portable reply hint instead of a Bash heredoc.

Pullfrog  | View workflow run | Using grok-4.7 | 𝕏

@leynier
leynier force-pushed the feat/agent-conversations branch from 6f3199d to fabd437 Compare October 6, 2026 18:14
@leynier
leynier force-pushed the feat/agent-conversations branch 5 times, most recently from 391e228 to 1b3cba7 Compare October 6, 2026 21:06
Base automatically changed from feat/inbox-mobile to main October 6, 2026 21:24
@leynier
leynier force-pushed the feat/agent-conversations branch from 1b3cba7 to c02fe7b Compare October 6, 2026 21:24
@leynier
leynier merged commit cb08209 into main Oct 6, 2026
19 checks passed
@leynier
leynier deleted the feat/agent-conversations branch October 6, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant