Skip to content

Commit

Permalink
Merge pull request #40 from stakpak/fix/infinite-loop
Browse files Browse the repository at this point in the history
Fix: Infinite loop
  • Loading branch information
kajogo777 authored Feb 24, 2025
2 parents e689c41 + a7ff3eb commit db7f7b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stakpak"
version = "0.1.40"
version = "0.1.41"
edition = "2021"

[dependencies]
Expand Down
9 changes: 7 additions & 2 deletions src/client/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,18 @@ pub struct GetDockerfileTemplateArgs {
pub runtime_version: Option<String>,
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct RunAgentInput {
pub checkpoint_id: Uuid,

pub input: AgentInput,
}

impl PartialEq for RunAgentInput {
fn eq(&self, other: &Self) -> bool {
self.input == other.input
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct RunAgentOutput {
pub checkpoint: AgentCheckpointListItem,
Expand Down
5 changes: 3 additions & 2 deletions src/commands/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ impl AgentCommands {
get_or_create_session(&client, agent_id, checkpoint_id, Some(input.clone()))
.await?;

if let Some(flow_ref) = &session.flow_ref {
// TODO: Better way to allow sync for specific agents
if matches!(agent_id, AgentID::KevinV1) && session.flow_ref.is_some() {
let config_clone = config.clone();
let client_clone = Client::new(&config_clone).map_err(|e| e.to_string())?;
let flow_ref = flow_ref.clone();
let flow_ref = session.flow_ref.clone().unwrap();
tokio::spawn(async move {
flow::sync(&config_clone, &client_clone, &flow_ref, None).await
});
Expand Down

0 comments on commit db7f7b9

Please sign in to comment.