mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Apply argument comment lint across codex-rs
This commit is contained in:
@@ -125,7 +125,7 @@ pub async fn load_tasks(
|
||||
// In later milestones, add a small debounce, spinner, and error display.
|
||||
let tasks = tokio::time::timeout(
|
||||
Duration::from_secs(5),
|
||||
backend.list_tasks(env, Some(20), None),
|
||||
backend.list_tasks(env, Some(20), /*cursor=*/ None),
|
||||
)
|
||||
.await??;
|
||||
// Hide review-only tasks from the main list.
|
||||
|
||||
@@ -171,7 +171,7 @@ async fn run_exec_command(args: crate::cli::ExecCommand) -> anyhow::Result<()> {
|
||||
&env_id,
|
||||
&prompt,
|
||||
&git_ref,
|
||||
false,
|
||||
/*qa_mode=*/ false,
|
||||
attempts,
|
||||
)
|
||||
.await?;
|
||||
@@ -827,7 +827,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
let backend = Arc::clone(&backend);
|
||||
let tx = tx.clone();
|
||||
tokio::spawn(async move {
|
||||
let res = app::load_tasks(&*backend, None).await;
|
||||
let res = app::load_tasks(&*backend, /*env=*/ None).await;
|
||||
let _ = tx.send(app::AppEvent::TasksLoaded {
|
||||
env: None,
|
||||
result: res,
|
||||
@@ -861,7 +861,10 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
let headers = util::build_chatgpt_headers().await;
|
||||
|
||||
// Run autodetect. If it fails, we keep using "All".
|
||||
let res = crate::env_detect::autodetect_environment_id(&base_url, &headers, None).await;
|
||||
let res = crate::env_detect::autodetect_environment_id(
|
||||
&base_url, &headers, /*desired_label=*/ None,
|
||||
)
|
||||
.await;
|
||||
let _ = tx.send(app::AppEvent::EnvironmentAutodetected(res));
|
||||
});
|
||||
}
|
||||
@@ -1105,7 +1108,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
ov.base_can_apply = true;
|
||||
ov.apply_selection_to_fields();
|
||||
} else {
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, None);
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, /*attempt_total_hint=*/ None);
|
||||
{
|
||||
let base = overlay.base_attempt_mut();
|
||||
base.diff_lines = diff_lines.clone();
|
||||
@@ -1178,7 +1181,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, None);
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, /*attempt_total_hint=*/ None);
|
||||
{
|
||||
let base = overlay.base_attempt_mut();
|
||||
base.text_lines = conv.clone();
|
||||
@@ -1216,7 +1219,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
.as_ref()
|
||||
.map(|d| d.lines().map(str::to_string).collect())
|
||||
.unwrap_or_default();
|
||||
let text_lines = conversation_lines(None, &attempt.messages);
|
||||
let text_lines = conversation_lines(/*prompt=*/ None, &attempt.messages);
|
||||
ov.attempts.push(app::AttemptView {
|
||||
turn_id: Some(attempt.turn_id.clone()),
|
||||
status: attempt.status,
|
||||
@@ -1263,7 +1266,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
ov.current_view = app::DetailView::Prompt;
|
||||
ov.apply_selection_to_fields();
|
||||
} else {
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, None);
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, /*attempt_total_hint=*/ None);
|
||||
{
|
||||
let base = overlay.base_attempt_mut();
|
||||
base.text_lines = pretty;
|
||||
@@ -1500,9 +1503,9 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
let backend = Arc::clone(&backend);
|
||||
let best_of_n = page.best_of_n;
|
||||
tokio::spawn(async move {
|
||||
let git_ref = resolve_git_ref(None).await;
|
||||
let git_ref = resolve_git_ref(/*branch_override=*/ None).await;
|
||||
|
||||
let result = codex_cloud_tasks_client::CloudBackend::create_task(&*backend, &env, &text, &git_ref, false, best_of_n).await;
|
||||
let result = codex_cloud_tasks_client::CloudBackend::create_task(&*backend, &env, &text, &git_ref, /*qa_mode=*/ false, best_of_n).await;
|
||||
let evt = match result {
|
||||
Ok(ok) => app::AppEvent::NewTaskSubmitted(Ok(ok)),
|
||||
Err(e) => app::AppEvent::NewTaskSubmitted(Err(format!("{e}"))),
|
||||
@@ -1685,11 +1688,11 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
needs_redraw = true;
|
||||
}
|
||||
KeyCode::Down | KeyCode::Char('j') => {
|
||||
if let Some(ov) = &mut app.diff_overlay { ov.sd.scroll_by(1); }
|
||||
if let Some(ov) = &mut app.diff_overlay { ov.sd.scroll_by(/*delta=*/ 1); }
|
||||
needs_redraw = true;
|
||||
}
|
||||
KeyCode::Up | KeyCode::Char('k') => {
|
||||
if let Some(ov) = &mut app.diff_overlay { ov.sd.scroll_by(-1); }
|
||||
if let Some(ov) = &mut app.diff_overlay { ov.sd.scroll_by(/*delta=*/ -1); }
|
||||
needs_redraw = true;
|
||||
}
|
||||
KeyCode::PageDown | KeyCode::Char(' ') => {
|
||||
@@ -1721,7 +1724,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
KeyCode::PageUp => { if let Some(m) = app.env_modal.as_mut() { let step = 10usize; m.selected = m.selected.saturating_sub(step); } needs_redraw = true; }
|
||||
KeyCode::Char('n') => {
|
||||
if app.env_filter.is_none() {
|
||||
app.new_task = Some(crate::new_task::NewTaskPage::new(None, app.best_of_n));
|
||||
app.new_task = Some(crate::new_task::NewTaskPage::new(/*env_id=*/ None, app.best_of_n));
|
||||
} else {
|
||||
app.new_task = Some(crate::new_task::NewTaskPage::new(app.env_filter.clone(), app.best_of_n));
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ impl NewTaskPage {
|
||||
|
||||
impl Default for NewTaskPage {
|
||||
fn default() -> Self {
|
||||
Self::new(None, 1)
|
||||
Self::new(/*env_id=*/ None, /*best_of_n=*/ 1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,7 +582,10 @@ fn style_conversation_lines(
|
||||
speaker = Some(ConversationSpeaker::User);
|
||||
in_code = false;
|
||||
bullet_indent = None;
|
||||
styled.push(conversation_header_line(ConversationSpeaker::User, None));
|
||||
styled.push(conversation_header_line(
|
||||
ConversationSpeaker::User,
|
||||
/*attempt=*/ None,
|
||||
));
|
||||
last_src = Some(src_idx);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ pub async fn load_auth_manager() -> Option<AuthManager> {
|
||||
let config = Config::load_with_cli_overrides(Vec::new()).await.ok()?;
|
||||
Some(AuthManager::new(
|
||||
config.codex_home,
|
||||
false,
|
||||
/*enable_codex_api_key_env=*/ false,
|
||||
config.cli_auth_credentials_store_mode,
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user