aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 11:06:46 +01:00
parent df99318392
commit 86e7c72e5f
10383 changed files with 749164 additions and 749170 deletions

View File

@@ -0,0 +1,40 @@
#![cfg(test)]
use super::*;
use pretty_assertions::assert_eq;
#[tokio::test]
async fn guardian_prompt_cache_key_is_scoped_to_parent_thread() {
let session_source =
SessionSource::SubAgent(SubAgentSource::Other(GUARDIAN_REVIEWER_NAME.to_string()));
let parent_thread_id = ThreadId::new();
let key = prompt_cache_key_override_for_review_session(&session_source, Some(parent_thread_id))
.expect("guardian prompt cache key");
assert_eq!(key, format!("guardian:{parent_thread_id}"));
assert!(
key.len() <= 64,
"guardian prompt cache key should fit the Responses API limit"
);
assert_eq!(
key,
prompt_cache_key_override_for_review_session(&session_source, Some(parent_thread_id))
.expect("same guardian prompt cache key")
);
assert_ne!(
key,
prompt_cache_key_override_for_review_session(&session_source, Some(ThreadId::new()))
.expect("different parent guardian prompt cache key")
);
assert_eq!(
None,
prompt_cache_key_override_for_review_session(&SessionSource::Cli, Some(parent_thread_id))
);
assert_eq!(
None,
prompt_cache_key_override_for_review_session(
&session_source,
/*parent_thread_id*/ None
)
);
}