From 343f2a8a6148b8004d6f4d74fb779b4f30c9686a Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 03:11:22 +0100 Subject: M1-M5: sessions, six tools, approvals, prompt, Ctrl-C, target gate - append-only JSONL sessions with --continue/--session; reasoning stored, stripped on replay - read/write/edit/grep/glob + bash with timeout and capped output - diff-preview approval for the first edit of a session, per-call approval for bash - system prompt frozen per session with AGENTS.md snapshot and change warning - SIGINT aborts the turn, second Ctrl-C exits - glibc gate ignores weak symbols; verified in linux/386 debian:12 - acceptance test (calculator in C) passes on both x86-64 and i386 --- src/config.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index b781637..a1d7c42 100644 --- a/src/config.rs +++ b/src/config.rs @@ -8,7 +8,10 @@ pub struct Config { pub base_url: String, pub api_key: String, pub model: String, + /// Session id, sent to the provider as `x-opencode-session`. Filled in once + /// the session exists. pub session: String, + pub yolo: bool, } impl Config { @@ -16,7 +19,7 @@ impl Config { pub fn resolve( model: Option, base_url: Option, - session: Option, + yolo: bool, ) -> Result { Ok(Config { api_key: api_key()?, @@ -26,7 +29,8 @@ impl Config { model: model .or_else(|| env_nonempty("AGENT686_MODEL")) .unwrap_or_else(|| DEFAULT_MODEL.to_string()), - session: session.unwrap_or_else(crate::session::new_id), + session: String::new(), + yolo, }) } @@ -40,7 +44,7 @@ fn env_nonempty(key: &str) -> Option { } /// The key comes from the environment first, then from a file, so a key never -/// has to live in shell history or in a process listing. +/// has to live in shell history. fn api_key() -> Result { if let Some(k) = env_nonempty("OPENCODE_API_KEY") { return Ok(k.trim().to_string()); -- cgit v1.2.3