mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +03:00
A few more
This commit is contained in:
@@ -114,7 +114,9 @@ pub fn review_request_from_target(
|
||||
if sha.is_empty() {
|
||||
return Err(ReviewTargetError::EmptySha);
|
||||
}
|
||||
let title = title.map(|t| t.trim().to_string()).filter(|t| !t.is_empty());
|
||||
let title = title
|
||||
.map(|t| t.trim().to_string())
|
||||
.filter(|t| !t.is_empty());
|
||||
let (prompt, hint) = review_commit_prompt(&sha, title.as_deref());
|
||||
let short_sha: String = sha.chars().take(min(7, sha.len())).collect();
|
||||
let display_text = if let Some(title) = title {
|
||||
|
||||
@@ -30,8 +30,8 @@ use codex_core::protocol::Event;
|
||||
use codex_core::protocol::EventMsg;
|
||||
use codex_core::protocol::Op;
|
||||
use codex_core::protocol::SessionSource;
|
||||
use codex_core::review_prompts::review_request_from_target;
|
||||
use codex_core::review_prompts::ReviewTarget;
|
||||
use codex_core::review_prompts::review_request_from_target;
|
||||
use codex_protocol::config_types::SandboxMode;
|
||||
use codex_protocol::user_input::UserInput;
|
||||
use event_processor_with_human_output::EventProcessorWithHumanOutput;
|
||||
@@ -402,9 +402,7 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
|
||||
} else {
|
||||
custom.to_string()
|
||||
};
|
||||
ReviewTarget::Custom {
|
||||
instructions: text,
|
||||
}
|
||||
ReviewTarget::Custom { instructions: text }
|
||||
} else if let Some(branch) = &args.branch {
|
||||
ReviewTarget::BaseBranch {
|
||||
branch: branch.clone(),
|
||||
@@ -431,9 +429,8 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
|
||||
};
|
||||
|
||||
let mut built_request =
|
||||
review_request_from_target(target, append_to_original_thread).map_err(|err| {
|
||||
anyhow::anyhow!("invalid review target: {err}")
|
||||
})?;
|
||||
review_request_from_target(target, append_to_original_thread)
|
||||
.map_err(|err| anyhow::anyhow!("invalid review target: {err}"))?;
|
||||
|
||||
if let Some(hint_override) = &args.hint {
|
||||
built_request.review_request.user_facing_hint = hint_override.clone();
|
||||
|
||||
2
codex-rs/tui/config.toml
Normal file
2
codex-rs/tui/config.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[projects."/Users/jif/code/codex"]
|
||||
trust_level = "untrusted"
|
||||
@@ -2777,9 +2777,9 @@ impl ChatWidget {
|
||||
items.push(SelectionItem {
|
||||
name: format!("{current_branch} -> {branch}"),
|
||||
actions: vec![Box::new(move |tx3: &AppEventSender| {
|
||||
if let Some(review_request) =
|
||||
build_review_request(ReviewTarget::BaseBranch { branch: branch.clone() })
|
||||
{
|
||||
if let Some(review_request) = build_review_request(ReviewTarget::BaseBranch {
|
||||
branch: branch.clone(),
|
||||
}) {
|
||||
tx3.send(AppEvent::CodexOp(Op::Review { review_request }));
|
||||
}
|
||||
})],
|
||||
@@ -2841,19 +2841,19 @@ impl ChatWidget {
|
||||
"Type instructions and press Enter".to_string(),
|
||||
None,
|
||||
Box::new(move |prompt: String| {
|
||||
let trimmed = prompt.trim().to_string();
|
||||
if trimmed.is_empty() {
|
||||
return;
|
||||
}
|
||||
if let Some(review_request) =
|
||||
build_review_request(ReviewTarget::Custom { instructions: trimmed })
|
||||
{
|
||||
tx.send(AppEvent::CodexOp(Op::Review { review_request }));
|
||||
}
|
||||
}),
|
||||
);
|
||||
self.bottom_pane.show_view(Box::new(view));
|
||||
}
|
||||
let trimmed = prompt.trim().to_string();
|
||||
if trimmed.is_empty() {
|
||||
return;
|
||||
}
|
||||
if let Some(review_request) = build_review_request(ReviewTarget::Custom {
|
||||
instructions: trimmed,
|
||||
}) {
|
||||
tx.send(AppEvent::CodexOp(Op::Review { review_request }));
|
||||
}
|
||||
}),
|
||||
);
|
||||
self.bottom_pane.show_view(Box::new(view));
|
||||
}
|
||||
|
||||
pub(crate) fn token_usage(&self) -> TokenUsage {
|
||||
self.token_info
|
||||
|
||||
Reference in New Issue
Block a user