c6d73d98de
Rename the 14 workspace member crates from `deepseek-*` (and `deepseek-tui-*`) to `codewhale-*`. Internal-only — binary names (`deepseek` and `deepseek-tui`) are intentionally untouched in this phase; they move in the next phase along with the deprecation shims. Affects: - 14 `[package] name = "..."` declarations. - All inter-crate `[dependencies]` entries that referenced the old package names. - All `use deepseek_*::...` statements rewritten to `use codewhale_*`. - Cargo.lock regenerated. CI workflows and release scripts that pass `-p deepseek-*` still reference the old names; those move with the binary rename phase so that pair lands together. Local gates green: `cargo check --workspace --all-targets --locked`, `cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`, `cargo test --workspace --all-features --locked` (3226+ pass, 0 fail). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
51 lines
1.8 KiB
Rust
51 lines
1.8 KiB
Rust
use codewhale_protocol::{EventFrame, ThreadListParams, ThreadRequest, ThreadResumeParams};
|
|
|
|
#[test]
|
|
fn thread_resume_params_round_trip() {
|
|
let request = ThreadRequest::Resume(ThreadResumeParams {
|
|
thread_id: "thread-123".to_string(),
|
|
history: None,
|
|
path: None,
|
|
model: Some("deepseek-v4-pro".to_string()),
|
|
model_provider: Some("deepseek".to_string()),
|
|
cwd: None,
|
|
approval_policy: Some("on-request".to_string()),
|
|
sandbox: Some("workspace-write".to_string()),
|
|
config: None,
|
|
base_instructions: Some("base".to_string()),
|
|
developer_instructions: Some("dev".to_string()),
|
|
personality: Some("default".to_string()),
|
|
persist_extended_history: true,
|
|
});
|
|
|
|
let encoded = serde_json::to_string(&request).expect("serialize request");
|
|
let decoded: ThreadRequest = serde_json::from_str(&encoded).expect("deserialize request");
|
|
match decoded {
|
|
ThreadRequest::Resume(params) => {
|
|
assert_eq!(params.thread_id, "thread-123");
|
|
assert_eq!(params.model.as_deref(), Some("deepseek-v4-pro"));
|
|
assert!(params.persist_extended_history);
|
|
}
|
|
other => panic!("unexpected request: {other:?}"),
|
|
}
|
|
}
|
|
|
|
#[test]
|
|
fn thread_list_params_defaults_are_serializable() {
|
|
let request = ThreadRequest::List(ThreadListParams {
|
|
include_archived: false,
|
|
limit: Some(20),
|
|
});
|
|
let encoded = serde_json::to_string_pretty(&request).expect("serialize list request");
|
|
assert!(encoded.contains("include_archived"));
|
|
}
|
|
|
|
#[test]
|
|
fn event_frame_serialization_contains_expected_tag() {
|
|
let frame = EventFrame::TurnComplete {
|
|
turn_id: "turn-1".to_string(),
|
|
};
|
|
let encoded = serde_json::to_string(&frame).expect("serialize frame");
|
|
assert!(encoded.contains("turn_complete"));
|
|
}
|