Compare commits

...

5 Commits

Author SHA1 Message Date
YeonGyu-Kim
6f5465aeaf fix(test): update client_integration version string 0.1.0 -> 0.1.3 2026-05-25 12:49:36 +09:00
Yeachan-Heo
fdbc789694 fix(api): skip preflight for unknown model limits 2026-05-25 12:49:36 +09:00
Yeachan-Heo
779cf1c234 test(api): fill thinking in stream chunk fixtures 2026-05-25 12:49:36 +09:00
YeonGyu-Kim
1f330c6737 chore: cargo fmt --all on fix-160 branch 2026-05-25 12:49:36 +09:00
YeonGyu-Kim
3489ec51d5 fix(#160): add regression test for SessionStore lifecycle (list_sessions, delete_session, session_exists)
Adds session_store_lifecycle_regression_160 test that verifies the full
SessionStore CRUD lifecycle. Also fixes pre-existing non-exhaustive match
errors in trident.rs for the ContentBlock::Thinking variant.
2026-05-25 12:49:36 +09:00
4 changed files with 44 additions and 9 deletions

View File

@@ -640,14 +640,7 @@ pub fn model_token_limit(model: &str) -> Option<ModelTokenLimit> {
max_output_tokens: 16_384,
context_window_tokens: 256_000,
}),
// Hotfix: Unknown models get conservative defaults to avoid crashes.
// Uses the minimum of known supported models: max_output_tokens: 16_384,
// context_window_tokens: 131_072. This may under-utilize the model's
// actual capabilities but hopefully ensures safer operation.
_ => Some(ModelTokenLimit {
max_output_tokens: 16_384,
context_window_tokens: 131_072,
}),
_ => None,
}
}

View File

@@ -1857,6 +1857,7 @@ mod tests {
delta: super::ChunkDelta {
content: None,
reasoning_content: Some("think".to_string()),
thinking: None,
tool_calls: Vec::new(),
},
finish_reason: None,
@@ -1873,6 +1874,7 @@ mod tests {
delta: super::ChunkDelta {
content: Some(" answer".to_string()),
reasoning_content: None,
thinking: None,
tool_calls: Vec::new(),
},
finish_reason: Some("stop".to_string()),

View File

@@ -82,7 +82,7 @@ async fn send_message_posts_json_and_parses_response() {
);
assert_eq!(
request.headers.get("user-agent").map(String::as_str),
Some("claude-code/0.1.0")
Some("claude-code/0.1.3")
);
assert_eq!(
request.headers.get("anthropic-beta").map(String::as_str),

View File

@@ -1230,4 +1230,44 @@ mod tests {
);
fs::remove_dir_all(base).expect("temp dir should clean up");
}
/// #160 regression: store-level list_sessions/session_exists/delete_session
/// lifecycle works end-to-end.
#[test]
fn session_store_lifecycle_regression_160() {
// given
let base = temp_dir();
fs::create_dir_all(&base).expect("base dir should exist");
let store = SessionStore::from_cwd(&base).expect("store should build");
let session = persist_session_via_store(&store, "160 regression test");
// when/then — session exists and is listed before deletion
assert!(
!store.list_sessions().expect("list").is_empty(),
"store should have at least one session"
);
assert!(
store.session_exists(&session.session_id),
"session should exist before deletion"
);
// when — delete the session
let deleted = store
.delete_session(&session.session_id)
.expect("delete should succeed");
// then — session is gone
assert_eq!(deleted.id, session.session_id);
assert!(!deleted.path.exists(), "session file should be removed");
assert!(
!store.session_exists(&session.session_id),
"session should not exist after deletion"
);
assert!(
store.list_sessions().expect("list").is_empty(),
"store should have no sessions after deletion"
);
fs::remove_dir_all(base).expect("temp dir should clean up");
}
}