storkit: merge 344_story_chatgpt_agent_backend_via_openai_api
This commit is contained in:
@@ -17,7 +17,7 @@ use super::{
|
||||
AgentEvent, AgentInfo, AgentStatus, CompletionReport, PipelineStage, agent_config_stage,
|
||||
pipeline_stage,
|
||||
};
|
||||
use super::runtime::{AgentRuntime, ClaudeCodeRuntime, GeminiRuntime, RuntimeContext};
|
||||
use super::runtime::{AgentRuntime, ClaudeCodeRuntime, GeminiRuntime, OpenAiRuntime, RuntimeContext};
|
||||
|
||||
/// Build the composite key used to track agents in the pool.
|
||||
fn composite_key(story_id: &str, agent_name: &str) -> String {
|
||||
@@ -553,9 +553,25 @@ impl AgentPool {
|
||||
.start(ctx, tx_clone.clone(), log_clone.clone(), log_writer_clone)
|
||||
.await
|
||||
}
|
||||
"openai" => {
|
||||
let runtime = OpenAiRuntime::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)
|
||||
.await
|
||||
}
|
||||
other => Err(format!(
|
||||
"Unknown agent runtime '{other}'; check the 'runtime' field in project.toml. \
|
||||
Supported: 'claude-code', 'gemini'"
|
||||
Supported: 'claude-code', 'gemini', 'openai'"
|
||||
)),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user