storkit: merge 345_story_gemini_agent_backend_via_google_ai_api

This commit is contained in:
Dave
2026-03-20 22:51:16 +00:00
parent c930c537bc
commit 79ee6eb0dc
4 changed files with 849 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ use super::{
AgentEvent, AgentInfo, AgentStatus, CompletionReport, PipelineStage, agent_config_stage,
pipeline_stage,
};
use super::runtime::{AgentRuntime, ClaudeCodeRuntime, RuntimeContext};
use super::runtime::{AgentRuntime, ClaudeCodeRuntime, GeminiRuntime, RuntimeContext};
/// Build the composite key used to track agents in the pool.
fn composite_key(story_id: &str, agent_name: &str) -> String {
@@ -531,6 +531,23 @@ impl AgentPool {
prompt,
cwd: wt_path_str,
inactivity_timeout_secs,
mcp_port: port_for_task,
};
runtime
.start(ctx, tx_clone.clone(), log_clone.clone(), log_writer_clone)
.await
}
"gemini" => {
let runtime = GeminiRuntime::new();
let ctx = RuntimeContext {
story_id: sid.clone(),
agent_name: aname.clone(),
command,
args,
prompt,
cwd: wt_path_str,
inactivity_timeout_secs,
mcp_port: port_for_task,
};
runtime
.start(ctx, tx_clone.clone(), log_clone.clone(), log_writer_clone)
@@ -538,7 +555,7 @@ impl AgentPool {
}
other => Err(format!(
"Unknown agent runtime '{other}'; check the 'runtime' field in project.toml. \
Supported: 'claude-code'"
Supported: 'claude-code', 'gemini'"
)),
};