Skip to content

feat: ask agents and wait for replies with alera inbox - #912

Merged
leynier merged 1 commit into
mainfrom
feat/inbox-cli
Oct 6, 2026
Merged

leynier merged 1 commit into
mainfrom
feat/inbox-cli

Conversation

@leynier

@leynier leynier commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Summary

alera inbox lets any process on the machine (another agent session, a script, an integration) ask an Alera agent a question and read the answer later, without an Alera terminal.

  • alera inbox targets [--workspace] lists askable agents and how a question reaches them.
  • alera inbox ask --to <handle> | --workspace <id> [--agent claude] | --thread <question> --body|--body-file|--body-stdin [--subject] [--priority] [--expires-in 30m] prints the question id.
  • alera inbox wait --question <id> | --inbox ext:ci [--after <cursor>] [--timeout 2h] chains host waits past the 10 minute host ceiling and retries across a host restart. It exits 2 on timeout so scripts can tell "no answer yet" from errors.
  • alera inbox list|threads|show|read|cancel|purge --confirm.
  • --inbox defaults to ALERA_EXTERNAL_INBOX, then ext:user. A follow-up inherits its thread's inbox.

Stacked on the host PR.

Validation

  • cli_inbox_tests cover duration parsing, ask/wait/purge flags and conflicting targets or bodies. inbox_commands unit tests cover the inbox address default, exit codes and the human summary.
  • cargo clippy -p alera-cli --all-targets -- -D warnings passes.
  • The max-lines ratchet passes.

Risk

New top-level command only. Existing commands are unchanged apart from read_body becoming crate-visible.

@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

alera inbox wait can hang on permanent errors and print a blank reply, filtered thread listings can skip matches, and the pasted reply hint fails outside bash.

Reviewed changes across the store, the host verbs, and the new CLI.

  • Ask and wait. alera inbox asks a running agent from outside a terminal and chains host waits past the 10 minute ceiling, exiting 2 on timeout.
  • Host API. inbox.* is advertised as inboxV1, allowed for paired phones except inbox.wait, and named on the hub reverse allowlist.
  • Store. Questions and replies are orchestration rows with reply_to_id and external_meta. Delivered ext: rows no longer expire, and old threads are pruned.
  • Delivery. A paste larger than one batch stays queued instead of being marked delivered, and external questions get their own banner.
  • Refresh and push. The host emits inboxChanged and an attention push that carries ids, not reply text.
  • Orchestration guard. ext: handles are rejected as terminal identities, and orchestration requests now honor the mobile allowlist.

ℹ️ Nitpicks

  • skills/alera-orchestration/references/messaging.md still documents only alera orchestration inbox (a terminal mailbox). Agents will not discover alera inbox, and the two names are easy to mix up.

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

Comment thread rust/alera-cli/src/inbox_commands.rs Outdated
Comment thread rust/alera-core/src/runtime/inbox_queries.rs Outdated
Comment thread rust/alera-cli/src/terminal_host/server/inbox_wait.rs
Comment thread rust/alera-cli/src/terminal_host/orchestration/message_formatter.rs Outdated
Comment thread rust/alera-cli/src/terminal_host/server/inbox_requests.rs
Comment thread rust/alera-cli/src/inbox_commands.rs Outdated
@leynier
leynier changed the base branch from main to feat/inbox-host 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.

ℹ️ No new issues in this delta.

Reviewed changes since the prior review at 9819a52. The branch is now the CLI commit on feat/inbox-host, and alera inbox wait no longer retries a host refusal.

  • Classified wait failures. A live host's error, including an unknown question and a missing inboxV1, returns immediately. A dropped connection keeps retrying until the deadline.
  • Closed the pending exit. The slice is never 0, and a pending poll is reported as timeout so the process exits 2.
  • Named cancel and read results. Human output covers a cancelled question, a mark-read count, and a purge count.

Pullfrog  | Fix it ➔ | View workflow run | Using grok-4.7 | 𝕏

@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 in this delta.

Reviewed changes since the prior review at 08a912e. The branch was restacked, and the rewritten CLI commit separates usage failures from wait timeouts and prints the listing cursor.

  • Usage exit code. usage returns 64, so a missing --body or purge without --confirm is no longer the same exit as a wait timeout.
  • Thread cursor. Human listings append more: --before <n> when the host returns nextBefore.

Pullfrog  | Fix it ➔ | View workflow run | Using grok-4.7 | 𝕏

@leynier
leynier force-pushed the feat/inbox-cli branch 2 times, most recently from cc64097 to 8ebd3ca Compare October 6, 2026 19:32
Base automatically changed from feat/inbox-host to main October 6, 2026 20:11
@leynier
leynier merged commit 742c8c1 into main Oct 6, 2026
19 checks passed
@leynier
leynier deleted the feat/inbox-cli branch October 6, 2026 20:38
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