Skip to content

Commit 1529cf4

Browse files
committed
update schema, fix bazel test setup
1 parent 4b52d37 commit 1529cf4

File tree

4 files changed

+80
-13
lines changed

4 files changed

+80
-13
lines changed

codex-rs/core/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ codex_rust_crate(
2828
#
2929
# TODO(aibrahim): Update the tests so that `just bazel-remote-test` succeeds
3030
# without this workaround.
31-
test_data_extra = ["//:AGENTS.md"],
31+
test_data_extra = [
32+
"//:AGENTS.md",
33+
"config.schema.json",
34+
],
3235
integration_deps_extra = ["//codex-rs/core/tests/common:common"],
3336
test_tags = ["no-sandbox"],
3437
extra_binaries = [

codex-rs/core/config.schema.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
"apply_patch_freeform": {
7676
"type": "boolean"
7777
},
78+
"collab": {
79+
"type": "boolean"
80+
},
7881
"elevated_windows_sandbox": {
7982
"type": "boolean"
8083
},
@@ -96,6 +99,9 @@
9699
"experimental_windows_sandbox": {
97100
"type": "boolean"
98101
},
102+
"hierarchical_agents": {
103+
"type": "boolean"
104+
},
99105
"include_apply_patch_tool": {
100106
"type": "boolean"
101107
},
@@ -135,6 +141,14 @@
135141
},
136142
"additionalProperties": false
137143
},
144+
"feedback": {
145+
"description": "When `false`, disables feedback collection across Codex product surfaces. Defaults to `true`.",
146+
"allOf": [
147+
{
148+
"$ref": "#/definitions/FeedbackConfigToml"
149+
}
150+
]
151+
},
138152
"file_opener": {
139153
"description": "Optional URI-based file opener. If set, citations to files in the model output will be hyperlinked using the specified URI scheme.",
140154
"allOf": [
@@ -383,6 +397,32 @@
383397
"description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.",
384398
"type": "string"
385399
},
400+
"AltScreenMode": {
401+
"description": "Controls whether the TUI uses the terminal's alternate screen buffer.\n\n**Background:** The alternate screen buffer provides a cleaner fullscreen experience without polluting the terminal's scrollback history. However, it conflicts with terminal multiplexers like Zellij that strictly follow the xterm specification, which defines that alternate screen buffers should not have scrollback.\n\n**Zellij's behavior:** Zellij intentionally disables scrollback in alternate screen mode (see https://github.com/zellij-org/zellij/pull/1032) to comply with the xterm spec. This is by design and not configurable in Zellij—there is no option to enable scrollback in alternate screen mode.\n\n**Solution:** This setting provides a pragmatic workaround: - `auto` (default): Automatically detect the terminal multiplexer. If running in Zellij, disable alternate screen to preserve scrollback. Enable it everywhere else. - `always`: Always use alternate screen mode (original behavior before this fix). - `never`: Never use alternate screen mode. Runs in inline mode, preserving scrollback in all multiplexers.\n\nThe CLI flag `--no-alt-screen` can override this setting at runtime.",
402+
"oneOf": [
403+
{
404+
"description": "Auto-detect: disable alternate screen in Zellij, enable elsewhere.",
405+
"type": "string",
406+
"enum": [
407+
"auto"
408+
]
409+
},
410+
{
411+
"description": "Always use alternate screen (original behavior).",
412+
"type": "string",
413+
"enum": [
414+
"always"
415+
]
416+
},
417+
{
418+
"description": "Never use alternate screen (inline mode only).",
419+
"type": "string",
420+
"enum": [
421+
"never"
422+
]
423+
}
424+
]
425+
},
386426
"AnalyticsConfigToml": {
387427
"description": "Analytics settings loaded from config.toml. Fields are optional so we can apply defaults.",
388428
"type": "object",
@@ -486,6 +526,9 @@
486526
"apply_patch_freeform": {
487527
"type": "boolean"
488528
},
529+
"collab": {
530+
"type": "boolean"
531+
},
489532
"elevated_windows_sandbox": {
490533
"type": "boolean"
491534
},
@@ -507,6 +550,9 @@
507550
"experimental_windows_sandbox": {
508551
"type": "boolean"
509552
},
553+
"hierarchical_agents": {
554+
"type": "boolean"
555+
},
510556
"include_apply_patch_tool": {
511557
"type": "boolean"
512558
},
@@ -580,6 +626,16 @@
580626
},
581627
"additionalProperties": false
582628
},
629+
"FeedbackConfigToml": {
630+
"type": "object",
631+
"properties": {
632+
"enabled": {
633+
"description": "When `false`, disables the feedback flow across Codex product surfaces.",
634+
"type": "boolean"
635+
}
636+
},
637+
"additionalProperties": false
638+
},
583639
"ForcedLoginMethod": {
584640
"type": "string",
585641
"enum": [
@@ -1236,6 +1292,15 @@
12361292
"description": "Collection of settings that are specific to the TUI.",
12371293
"type": "object",
12381294
"properties": {
1295+
"alternate_screen": {
1296+
"description": "Controls whether the TUI uses the terminal's alternate screen buffer.\n\n- `auto` (default): Disable alternate screen in Zellij, enable elsewhere. - `always`: Always use alternate screen (original behavior). - `never`: Never use alternate screen (inline mode only, preserves scrollback).\n\nUsing alternate screen provides a cleaner fullscreen experience but prevents scrollback in terminal multiplexers like Zellij that follow the xterm spec.",
1297+
"default": "auto",
1298+
"allOf": [
1299+
{
1300+
"$ref": "#/definitions/AltScreenMode"
1301+
}
1302+
]
1303+
},
12391304
"animations": {
12401305
"description": "Enable animations (welcome screen, shimmer effects, spinners). Defaults to `true`.",
12411306
"default": true,

codex-rs/core/src/config/schema.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,21 @@ pub fn write_config_schema(out_path: &Path) -> anyhow::Result<()> {
7777
#[cfg(test)]
7878
mod tests {
7979
use super::config_schema_json;
80-
use similar::TextDiff;
80+
use pretty_assertions::assert_eq;
8181

8282
#[test]
8383
fn config_schema_matches_fixture() {
8484
let fixture_path = codex_utils_cargo_bin::find_resource!("config.schema.json")
8585
.expect("resolve config schema fixture path");
8686
let fixture = std::fs::read_to_string(fixture_path).expect("read config schema fixture");
87+
let fixture_value: serde_json::Value =
88+
serde_json::from_str(&fixture).expect("parse config schema fixture");
8789
let schema_json = config_schema_json().expect("serialize config schema");
88-
let schema_str = String::from_utf8(schema_json).expect("decode schema json");
89-
if fixture != schema_str {
90-
let diff = TextDiff::from_lines(&fixture, &schema_str)
91-
.unified_diff()
92-
.to_string();
93-
let short = diff.lines().take(50).collect::<Vec<_>>().join("\n");
94-
panic!(
95-
"Current schema for `config.toml` doesn't match the fixture. Run `just write-config-schema` to overwrite with your changes.\n\n{short}"
96-
);
97-
}
90+
let schema_value: serde_json::Value =
91+
serde_json::from_slice(&schema_json).expect("decode schema json");
92+
assert_eq!(
93+
fixture_value, schema_value,
94+
"Current schema for `config.toml` doesn't match the fixture. Run `just write-config-schema` to overwrite with your changes."
95+
);
9896
}
9997
}

codex-rs/core/src/config/types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ pub struct AnalyticsConfigToml {
290290
pub enabled: Option<bool>,
291291
}
292292

293-
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
293+
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema)]
294+
#[schemars(deny_unknown_fields)]
294295
pub struct FeedbackConfigToml {
295296
/// When `false`, disables the feedback flow across Codex product surfaces.
296297
pub enabled: Option<bool>,

0 commit comments

Comments
 (0)