Persona K66: a failed call's entry in the wake's calls names its reason
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c3a3761c78
commit
67b54f4855
2 changed files with 21 additions and 1 deletions
|
|
@ -867,7 +867,9 @@ pub(crate) fn decide_in(model: &dyn Model, segment_id: &str, packet: &Packet, na
|
|||
let answer = match model.ask(&request_id, &tuning.interpreter.model, &asking, Some(SPEECH_SCHEMA)) {
|
||||
Ok(answer) => answer,
|
||||
Err(failed) => {
|
||||
calls.push(json!({ "usage": failed.usage, "retry": false }));
|
||||
// A failed call names why, as the connector said it (K66): a turn cut at the output cap reads "the model's
|
||||
// turn ended early: MaxOutputTokens".
|
||||
calls.push(json!({ "usage": failed.usage, "retry": false, "failed": failed.reason }));
|
||||
let mut fault = json!({ "failed": failed.reason });
|
||||
if let Some(first) = parsed_first.take() {
|
||||
fault["retried"] = retried.take().unwrap_or_default();
|
||||
|
|
|
|||
|
|
@ -3571,3 +3571,21 @@ fn k64_the_view_never_says_unread_beside_a_read_of_the_same_target() {
|
|||
assert!(found.contains("It needs her to read https://ccrma.stanford.edu/~jos/pasp/: she read it about half an hour ago.") && !found.contains("not read it yet"), "{found}");
|
||||
assert!(view(false).contains("and she has not read it yet."), "a read that found nothing is no read of it");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// K66 (map 16.34.4): a failed call names why, with its usage, in the wake's calls.
|
||||
|
||||
/// An Interpreter whose every call is cut at the cap, as the kit reports a `MaxOutputTokens` stop.
|
||||
struct CutAtCap;
|
||||
|
||||
impl crate::projection::Model for CutAtCap {
|
||||
fn ask(&self, _request_id: &str, model: &str, _prompt: &str, _schema: Option<&str>) -> std::result::Result<crate::projection::Answer, crate::projection::Failed> {
|
||||
Err(crate::projection::Failed { reason: "the model's turn ended early: MaxOutputTokens".into(), usage: Some(crate::projection::Spent { model: model.into(), input_tokens: 8, output_tokens: 4096, cache_read_tokens: 0, cache_write_tokens: 0, reasoning_tokens: None }) })
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn k66_a_cut_answer_fails_the_turn_and_names_its_stop() {
|
||||
let decision = decide(&CutAtCap, "test", &packet(), "The room is warm.", "<typed>Hi.</typed>", &Tuning::default());
|
||||
assert_eq!((decision["failed"].as_str(), decision["calls"][0]["failed"].as_str(), decision["calls"][0]["usage"]["output_tokens"].as_u64()), (Some("the model's turn ended early: MaxOutputTokens"), Some("the model's turn ended early: MaxOutputTokens"), Some(4096)), "{decision}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue