@hej / sigit / commits / 127eab0

Add support for load_session in Agent implementation

Seto Elkahfi committed Apr 24, 2026 at 01:37 UTC 127eab02ddf837c32d9ee76573f9f9604b01038a
1 file changed +18 -5
src/main.rs
+18 -5
@@ -1,4 +1,4 @@
1 -//! siGit Code — an ACP coding agent that runs a local LLM via Onde.
1 +//! siGit Code — an ACP coding agent that runs a local LLM via Onde Inference platform.
2 //!
3 //! In interactive (TTY) mode **all** process output — `log::` crate events,
4 //! `tracing` events from mistralrs_core, and even raw `println!` calls buried
@@ -42,9 +42,9 @@ use onde::inference::SamplingConfig;
42 use agent_client_protocol::{
43 Agent, AgentCapabilities, AgentSideConnection, AuthMethod, AuthMethodAgent,
44 AuthenticateRequest, AuthenticateResponse, CancelNotification, Client, ContentBlock,
45 - ContentChunk, Implementation, InitializeRequest, InitializeResponse, NewSessionRequest,
46 - NewSessionResponse, PromptRequest, PromptResponse, ProtocolVersion, SessionId,
47 - SessionNotification, SessionUpdate, StopReason,
45 + ContentChunk, Implementation, InitializeRequest, InitializeResponse, LoadSessionRequest,
46 + LoadSessionResponse, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse,
47 + ProtocolVersion, SessionId, SessionNotification, SessionUpdate, StopReason,
48 };
49 use futures::future::LocalBoxFuture;
50 use onde::inference::{ChatEngine, GgufModelConfig, ToolDefinition, ToolResult};
@@ -121,7 +121,7 @@ impl Agent for SiGitAgent {
121 .auth_methods(vec![AuthMethod::Agent(AuthMethodAgent::new(
122 "sigit", "siGit",
123 ))])
124 - .agent_capabilities(AgentCapabilities::default()))
124 + .agent_capabilities(AgentCapabilities::default().load_session(true)))
125 }
126
127 async fn authenticate(
@@ -132,6 +132,19 @@ impl Agent for SiGitAgent {
132 Ok(AuthenticateResponse::default())
133 }
134
135 + async fn load_session(
136 + &self,
137 + args: LoadSessionRequest,
138 + ) -> agent_client_protocol::Result<LoadSessionResponse> {
139 + log::info!("load_session: id={}", args.session_id);
140 +
141 + // Clear conversation history — siGit doesn't persist sessions, so a
142 + // "load" is effectively a fresh start with the same session ID.
143 + self.engine.clear_history().await;
144 +
145 + Ok(LoadSessionResponse::new())
146 + }
147 +
148 async fn new_session(
149 &self,
150 _args: NewSessionRequest,