Status: Merged upstream — ALTAI tracks altaidevorg/isanagent main
Merged via: altaidevorg/isanagent#101 (ea90fa0)
Historical base (path pin era): 8c9eef2cf63f0b888f5b73778f056ba7d21467cf
Diff artifacts (historical): docs/cli/isanagent-oneshot-api.*.diff
isanagent::host::HostConfig {
// existing fields...
pub oneshot_prompt: Option<String>,
pub observe_tx: Option<mpsc::UnboundedSender<BusMessage>>,
pub scripted_responses: Option<Vec<String>>,
/// ALTAI terminal appearance. `no_color` / `NO_COLOR` still win.
pub theme: HostThemeMode, // Auto | Dark | Light | NoColor
pub compact_auto: Option<bool>,
pub compact_threshold_tokens: Option<usize>,
pub compact_tail_turns: Option<usize>,
}
pub async fn run_oneshot(config: HostConfig) -> HostResult<OneshotResult>;
pub struct OneshotResult { chat_id, run_id, outcome, final_text }
pub enum OneshotOutcome { Completed, Failed, Cancelled, TimedOut, ApprovalRequired, ClarificationRequired }
pub use HostThemeMode;- When
oneshot_promptis set, the interactive terminal is disabled. - A headless
altai-clichannel injects one inbound prompt and captures the final outbound. RunLifecycle::Terminatedcompletes the oneshot and shuts the host down.approval_requested/ clarification outbound ends with exit-friendly outcomes (no silent approve).scripted_responsesprovides an in-process mock provider for deterministic CI/smoke tests.- Startup banners for oneshot mode go to stderr so JSONL stdout stays clean.
themeselects ALTAI dark/light truecolor roles (or no-color structure); combined withno_colorbefore the Ratatui / line-mode channel starts.- Approval prompts offer
approve/deny/always/abort.alwaysgrants for the current process only. Edit approvals attachmetadata.edit_diffand map oneshot completion toApprovalRequiredwith the diff detail. compact_*host fields override memory compaction thresholds;compact_auto = Some(false)disables between-turn auto-compaction (short_term_threshold_tokens = usize::MAX) while manual/compactstill works.- Oneshot
--filepaths load throughload_host_file_attachments(text wrapped as<context-file>, images/PDFs as media parts). Terminal@pathparsing accepts text / image / PDF and fuzzy-resolves unique basenames under the sandbox.
Host oneshot / theme / approval / attachment APIs landed on IsanAgent main via
#101 (superseding the earlier
#99 / revert cycle). ALTAI
depends on git main again; the temporary tools/isanagent-oneshot path pin is
removed. pnpm isanagent:sync / CI continue to refresh the lockfile tip.
- Shared durable journal lives in
altai-core::journal(not this host surface). - Oneshot resumes approvals on
/dev/ttywhen available; otherwise exits withApprovalRequired/ClarificationRequiredfor non-TTY callers.