-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[1 of 3] Support long raw TUI goal objectives #27508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7fcf243
Support long raw TUI goal objectives
etraut-openai d4f8529
Simplify raw goal objective materialization
etraut-openai 45674d2
Simplify TUI goal objective file handling
etraut-openai bbc613c
Retry PR1 CI after infra timeout
etraut-openai f2b7e70
Delay goal file writes until replace confirmation
etraut-openai e1d67f0
Reject normalized managed goal paths
etraut-openai a989259
Simplify raw goal objective file handling
etraut-openai 62dbad3
Further simplify raw goal handling
etraut-openai 4075df8
Merge remote-tracking branch 'origin/main' into etraut/tui-goal-raw-o…
etraut-openai 2cfb435
fix TUI goal review findings
etraut-openai 71637ba
codex: address PR review feedback (#27508)
etraut-openai 7d0adde
codex: address PR review feedback (#27508)
etraut-openai 45e35b1
Simplify long goal objective materialization
etraut-openai e2bae86
Merge remote-tracking branch 'origin/main' into etraut/tui-goal-raw-o…
etraut-openai d68efca
codex: address PR review feedback (#27508)
etraut-openai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| //! Paths resolved using the app-server host's platform rules. | ||
|
|
||
| use std::fmt; | ||
|
|
||
| #[derive(Clone, Debug, PartialEq, Eq)] | ||
| pub struct AppServerPath(String); | ||
|
|
||
| impl AppServerPath { | ||
| pub fn from_app_server(path: impl Into<String>) -> Self { | ||
| Self(path.into()) | ||
| } | ||
|
|
||
| pub fn from_absolute_str(raw: &str) -> Option<Self> { | ||
| (raw.starts_with('/') || is_windows_absolute_path(raw)).then(|| Self(raw.to_string())) | ||
| } | ||
|
|
||
| pub fn as_str(&self) -> &str { | ||
| &self.0 | ||
| } | ||
|
|
||
| pub fn components(&self) -> Vec<&str> { | ||
| let separators = if is_windows_absolute_path(&self.0) { | ||
| &['/', '\\'][..] | ||
| } else { | ||
| &['/'][..] | ||
| }; | ||
| self.0 | ||
| .split(separators) | ||
| .filter(|part| !part.is_empty()) | ||
| .collect() | ||
| } | ||
|
|
||
| pub fn join(&self, segment: impl AsRef<str>) -> Self { | ||
| let is_windows = is_windows_absolute_path(&self.0); | ||
| let (path, separator) = if is_windows { | ||
| (self.0.trim_end_matches(['/', '\\']), '\\') | ||
| } else { | ||
| (self.0.trim_end_matches('/'), '/') | ||
| }; | ||
| Self(format!("{path}{separator}{}", segment.as_ref())) | ||
| } | ||
| } | ||
|
|
||
| impl fmt::Display for AppServerPath { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| self.0.fmt(f) | ||
| } | ||
| } | ||
|
|
||
| fn is_windows_absolute_path(path: &str) -> bool { | ||
| let bytes = path.as_bytes(); | ||
| (bytes.len() >= 3 | ||
| && bytes[0].is_ascii_alphabetic() | ||
| && bytes[1] == b':' | ||
| && matches!(bytes[2], b'\\' | b'/')) | ||
| || path.starts_with("\\\\") | ||
| || path.starts_with("//") | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.