mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
Merge remote-tracking branch 'origin/main' into dev/stevenlee/plugin-service-preview-routing
# Conflicts: # codex-rs/app-server/src/request_processors/plugins.rs # codex-rs/core-plugins/src/remote.rs
This commit is contained in:
@@ -12,12 +12,6 @@ pub enum ApprovalModeCliArg {
|
||||
/// is not in the "trusted" set.
|
||||
Untrusted,
|
||||
|
||||
/// DEPRECATED: Run all commands without asking for user approval.
|
||||
/// Only asks for approval if a command fails to execute, in which case it
|
||||
/// will escalate to the user to ask for un-sandboxed execution.
|
||||
/// Prefer `on-request` for interactive runs or `never` for non-interactive runs.
|
||||
OnFailure,
|
||||
|
||||
/// The model decides when to ask the user for approval.
|
||||
OnRequest,
|
||||
|
||||
@@ -30,7 +24,6 @@ impl From<ApprovalModeCliArg> for AskForApproval {
|
||||
fn from(value: ApprovalModeCliArg) -> Self {
|
||||
match value {
|
||||
ApprovalModeCliArg::Untrusted => AskForApproval::UnlessTrusted,
|
||||
ApprovalModeCliArg::OnFailure => AskForApproval::OnFailure,
|
||||
ApprovalModeCliArg::OnRequest => AskForApproval::OnRequest,
|
||||
ApprovalModeCliArg::Never => AskForApproval::Never,
|
||||
}
|
||||
|
||||
@@ -86,6 +86,17 @@ impl LegacyAppPathString {
|
||||
PathUri::try_from(self.clone()).ok()
|
||||
}
|
||||
|
||||
/// Renders this API path for display in a user interface.
|
||||
///
|
||||
/// Absolute paths are normalized using their inferred native convention.
|
||||
/// Strings that cannot be interpreted as absolute paths retain their raw
|
||||
/// API spelling.
|
||||
pub fn render_for_ui(&self) -> String {
|
||||
self.to_inferred_path_uri()
|
||||
.map(|path| path.inferred_native_path_string())
|
||||
.unwrap_or_else(|| self.0.clone())
|
||||
}
|
||||
|
||||
/// Parses this API string as a host-native absolute path.
|
||||
pub fn to_inferred_abs_path(&self) -> Option<AbsolutePathBuf> {
|
||||
AbsolutePathBuf::try_from(self.clone()).ok()
|
||||
|
||||
@@ -458,6 +458,7 @@ fn converts_absolute_api_paths_using_the_inferred_convention() {
|
||||
path.to_inferred_path_uri(),
|
||||
Some(PathUri::parse(expected_uri).expect("expected URI should parse")),
|
||||
);
|
||||
assert_eq!(path.render_for_ui(), raw_path);
|
||||
assert_eq!(
|
||||
PathUri::try_from(path.clone()),
|
||||
path.to_path_uri(convention)
|
||||
|
||||
Reference in New Issue
Block a user