mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
[codex-tui] pass thread source for tui threads (#21401)
## Summary - mark TUI-created thread starts and forks with explicit `thread_source = user` - add focused coverage for embedded and remote lifecycle request builders ## Why Thread analytics now consume an explicit thread-level source classification instead of inferring it from `session_source`. The TUI still omitted that field, so TUI-created interactive threads would continue to land as `null` even after the new analytics plumbing shipped. ## Validation - `cargo test -p codex-tui app_server_session --lib`
This commit is contained in:
committed by
GitHub
Unverified
parent
b9c50a53d7
commit
21295f47e2
@@ -87,6 +87,7 @@ use codex_app_server_protocol::ThreadSetNameParams;
|
||||
use codex_app_server_protocol::ThreadSetNameResponse;
|
||||
use codex_app_server_protocol::ThreadShellCommandParams;
|
||||
use codex_app_server_protocol::ThreadShellCommandResponse;
|
||||
use codex_app_server_protocol::ThreadSource;
|
||||
use codex_app_server_protocol::ThreadStartParams;
|
||||
use codex_app_server_protocol::ThreadStartResponse;
|
||||
use codex_app_server_protocol::ThreadStartSource;
|
||||
@@ -1195,6 +1196,7 @@ fn thread_start_params_from_config(
|
||||
config: config_request_overrides_from_config(config),
|
||||
ephemeral: Some(config.ephemeral),
|
||||
session_start_source,
|
||||
thread_source: Some(ThreadSource::User),
|
||||
persist_extended_history: false,
|
||||
..ThreadStartParams::default()
|
||||
}
|
||||
@@ -1260,6 +1262,7 @@ fn thread_fork_params_from_config(
|
||||
base_instructions: config.base_instructions.clone(),
|
||||
developer_instructions: config.developer_instructions.clone(),
|
||||
ephemeral: config.ephemeral,
|
||||
thread_source: Some(ThreadSource::User),
|
||||
persist_extended_history: false,
|
||||
..ThreadForkParams::default()
|
||||
}
|
||||
@@ -1561,6 +1564,7 @@ mod tests {
|
||||
.map(permissions_selection_from_active_profile)
|
||||
);
|
||||
assert_eq!(params.model_provider, Some(config.model_provider_id));
|
||||
assert_eq!(params.thread_source, Some(ThreadSource::User));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -1677,6 +1681,8 @@ mod tests {
|
||||
assert_eq!(start.permissions, None);
|
||||
assert_eq!(resume.permissions, None);
|
||||
assert_eq!(fork.permissions, None);
|
||||
assert_eq!(start.thread_source, Some(ThreadSource::User));
|
||||
assert_eq!(fork.thread_source, Some(ThreadSource::User));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1782,6 +1788,8 @@ mod tests {
|
||||
assert_eq!(start.permissions, None);
|
||||
assert_eq!(resume.permissions, None);
|
||||
assert_eq!(fork.permissions, None);
|
||||
assert_eq!(start.thread_source, Some(ThreadSource::User));
|
||||
assert_eq!(fork.thread_source, Some(ThreadSource::User));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user