mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
codex: omit available environment status (#29249)
This commit is contained in:
@@ -237,10 +237,8 @@ impl ContextualUserFragment for RenderedEnvironments {
|
||||
rendered.push_str(" <environment id=\"");
|
||||
push_xml_escaped_text(&mut rendered, id);
|
||||
rendered.push('"');
|
||||
if let Some(status) = environment.status {
|
||||
rendered.push_str(" status=\"");
|
||||
rendered.push_str(status.as_str());
|
||||
rendered.push('"');
|
||||
if matches!(environment.status, Some(EnvironmentStatus::Starting)) {
|
||||
rendered.push_str(" status=\"starting\"");
|
||||
}
|
||||
rendered.push_str(">\n");
|
||||
push_environment_values(&mut rendered, environment, " ");
|
||||
@@ -329,15 +327,6 @@ enum EnvironmentStatus {
|
||||
Available,
|
||||
}
|
||||
|
||||
impl EnvironmentStatus {
|
||||
fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Starting => "starting",
|
||||
Self::Available => "available",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn is_legacy_single(environments: &BTreeMap<String, EnvironmentState>) -> bool {
|
||||
environments.len() == 1
|
||||
&& matches!(
|
||||
|
||||
@@ -330,11 +330,11 @@ fn serialize_environment_context_with_multiple_selected_environments() {
|
||||
let expected = format!(
|
||||
r#"<environment_context>
|
||||
<environments>
|
||||
<environment id="local" status="available">
|
||||
<environment id="local">
|
||||
<cwd>{}</cwd>
|
||||
<shell>bash</shell>
|
||||
</environment>
|
||||
<environment id="remote" status="available">
|
||||
<environment id="remote">
|
||||
<cwd>{}</cwd>
|
||||
<shell>bash</shell>
|
||||
</environment>
|
||||
@@ -371,11 +371,11 @@ fn serialize_environment_context_prefers_environment_shell_when_present() {
|
||||
let expected = format!(
|
||||
r#"<environment_context>
|
||||
<environments>
|
||||
<environment id="local" status="available">
|
||||
<environment id="local">
|
||||
<cwd>{}</cwd>
|
||||
<shell>powershell</shell>
|
||||
</environment>
|
||||
<environment id="remote" status="available">
|
||||
<environment id="remote">
|
||||
<cwd>{}</cwd>
|
||||
<shell>cmd</shell>
|
||||
</environment>
|
||||
|
||||
@@ -40,11 +40,11 @@ fn renders_full_environment_state() -> Result<()> {
|
||||
vec![user_message(
|
||||
r#"<environment_context>
|
||||
<environments>
|
||||
<environment id="devbox" status="available">
|
||||
<environment id="devbox">
|
||||
<cwd>/workspace</cwd>
|
||||
<shell>bash</shell>
|
||||
</environment>
|
||||
<environment id="laptop" status="available">
|
||||
<environment id="laptop">
|
||||
<cwd>/repo</cwd>
|
||||
<shell>zsh</shell>
|
||||
</environment>
|
||||
@@ -96,7 +96,7 @@ fn renders_only_changed_environments() -> Result<()> {
|
||||
vec![user_message(
|
||||
r#"<environment_context>
|
||||
<environments>
|
||||
<environment id="laptop" status="available">
|
||||
<environment id="laptop">
|
||||
<cwd>/new-repo</cwd>
|
||||
<shell>zsh</shell>
|
||||
</environment>
|
||||
|
||||
Reference in New Issue
Block a user