-
Notifications
You must be signed in to change notification settings - Fork 7.9k
make codex better at git #10145
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
make codex better at git #10145
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e9d72bf
context in headers
pash-openai cd3c8f0
minor comment change
pash-openai 24f198d
cleanup
pash-openai 1e29e09
on-demand headers
pash-openai 3e86d7f
cleanup
pash-openai 6f9867f
cleanup
pash-openai d56aa8c
add e2e header test
pash-openai f1052e0
prewarm turn metadata
pash-openai e8bfe5a
on-demand headers
pash-openai 718ef24
cleanup
pash-openai 01cace3
removing line
pash-openai c94e43b
stale comment
pash-openai 1bc4f63
test fix
pash-openai 8e6a677
cleanup
pash-openai 242f6a5
test timeout
pash-openai 3807f36
Merge branch 'main' into codex/pash/session-workspace-git-context
pash-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
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
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
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,43 @@ | ||
| use std::collections::BTreeMap; | ||
| use std::path::Path; | ||
|
|
||
| use serde::Serialize; | ||
|
|
||
| use crate::git_info::get_git_remote_urls_assume_git_repo; | ||
| use crate::git_info::get_git_repo_root; | ||
| use crate::git_info::get_head_commit_hash; | ||
|
|
||
| #[derive(Serialize)] | ||
| struct TurnMetadataWorkspace { | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| associated_remote_urls: Option<BTreeMap<String, String>>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| latest_git_commit_hash: Option<String>, | ||
| } | ||
|
|
||
| #[derive(Serialize)] | ||
| struct TurnMetadata { | ||
| workspaces: BTreeMap<String, TurnMetadataWorkspace>, | ||
| } | ||
|
|
||
| pub(crate) async fn build_turn_metadata_header(cwd: &Path) -> Option<String> { | ||
| let repo_root = get_git_repo_root(cwd)?; | ||
|
|
||
| let (latest_git_commit_hash, associated_remote_urls) = tokio::join!( | ||
| get_head_commit_hash(cwd), | ||
| get_git_remote_urls_assume_git_repo(cwd) | ||
| ); | ||
| if latest_git_commit_hash.is_none() && associated_remote_urls.is_none() { | ||
| return None; | ||
| } | ||
|
|
||
| let mut workspaces = BTreeMap::new(); | ||
| workspaces.insert( | ||
| repo_root.to_string_lossy().into_owned(), | ||
| TurnMetadataWorkspace { | ||
| associated_remote_urls, | ||
| latest_git_commit_hash, | ||
| }, | ||
| ); | ||
| serde_json::to_string(&TurnMetadata { workspaces }).ok() | ||
| } |
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
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.