Fix provider tool history handling
This commit is contained in:
@@ -1585,8 +1585,9 @@ impl Display for StartAgentResult {
|
||||
/// interceptor can synthesize the marker on the next outbound input.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum RunAgentsResult {
|
||||
/// Orchestration launched. Carries the resolved configuration and one
|
||||
/// `AgentOutcome` per `agent_run_configs[]` entry, in input order.
|
||||
/// Orchestration launch completed. Carries the resolved configuration
|
||||
/// and one launch `AgentOutcome` per `agent_run_configs[]` entry, in input
|
||||
/// order. A launched child agent may still be running.
|
||||
Launched {
|
||||
model_id: String,
|
||||
harness_type: String,
|
||||
@@ -1670,6 +1671,8 @@ impl RunAgentsResult {
|
||||
.collect::<Vec<_>>();
|
||||
serde_json::json!({
|
||||
"status": "launched",
|
||||
"completion_state": "children_running",
|
||||
"instruction": "Child agents have only been launched, not completed. Wait for child-agent updates before repeating this work or reporting final results.",
|
||||
"model_id": model_id,
|
||||
"harness_type": harness_type,
|
||||
"execution_mode": execution_mode,
|
||||
|
||||
@@ -78,6 +78,8 @@ fn run_agents_model_content_contains_resolved_config_and_agent_outcomes() {
|
||||
content,
|
||||
serde_json::json!({
|
||||
"status": "launched",
|
||||
"completion_state": "children_running",
|
||||
"instruction": "Child agents have only been launched, not completed. Wait for child-agent updates before repeating this work or reporting final results.",
|
||||
"model_id": "resolved-model",
|
||||
"harness_type": "oz",
|
||||
"execution_mode": {
|
||||
|
||||
@@ -231,28 +231,26 @@ async fn suggestions_for_parse_error(
|
||||
ParseErrorReason::ArgumentError {
|
||||
command: _,
|
||||
error: UnexpectedArgument(arg),
|
||||
} => {
|
||||
if arg.span.end() == input.len() {
|
||||
// The unexpected argument could be a prefix for a subcommand.
|
||||
let prefix = arg.item.as_str();
|
||||
let results = (command_signature.subcommands.iter().filter_map(|subcmd| {
|
||||
options
|
||||
.match_strategy
|
||||
.get_match_type(prefix, subcmd.name.as_str())
|
||||
.map(|match_type| {
|
||||
let suggestion = Suggestion::with_same_display_and_replacement(
|
||||
subcmd.name.clone(),
|
||||
subcmd.description.as_ref().cloned(),
|
||||
SuggestionType::Subcommand,
|
||||
subcmd.priority.into(),
|
||||
);
|
||||
MatchedSuggestion::new(suggestion, match_type)
|
||||
})
|
||||
}))
|
||||
.sorted_by(MatchedSuggestion::cmp_by_display)
|
||||
.collect();
|
||||
return (results, false);
|
||||
}
|
||||
} if arg.span.end() == input.len() => {
|
||||
// The unexpected argument could be a prefix for a subcommand.
|
||||
let prefix = arg.item.as_str();
|
||||
let results = (command_signature.subcommands.iter().filter_map(|subcmd| {
|
||||
options
|
||||
.match_strategy
|
||||
.get_match_type(prefix, subcmd.name.as_str())
|
||||
.map(|match_type| {
|
||||
let suggestion = Suggestion::with_same_display_and_replacement(
|
||||
subcmd.name.clone(),
|
||||
subcmd.description.as_ref().cloned(),
|
||||
SuggestionType::Subcommand,
|
||||
subcmd.priority.into(),
|
||||
);
|
||||
MatchedSuggestion::new(suggestion, match_type)
|
||||
})
|
||||
}))
|
||||
.sorted_by(MatchedSuggestion::cmp_by_display)
|
||||
.collect();
|
||||
return (results, false);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ mod registry;
|
||||
|
||||
use std::cmp::Ordering;
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
use galaxy_js::TypedJsFunctionRef;
|
||||
pub use lookup::*;
|
||||
pub use registry::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
Reference in New Issue
Block a user