Skip to content

Commit 7bcc153

Browse files
stephentoubCopilot
andcommitted
Fix Rust checks for generated schema changes
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 174940c commit 7bcc153

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

rust/src/generated/api_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14784,7 +14784,7 @@ pub struct SandboxConfigUserPolicyNetwork {
1478414784
/// Whether outbound network traffic is allowed at all.
1478514785
#[serde(skip_serializing_if = "Option::is_none")]
1478614786
pub allow_outbound: Option<bool>,
14787-
/// HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, requires that endpoint to be reachable over IPv4 (the [::] dual-stack wildcard is accepted and routed through the IPv4 gateway), and does not support proxy credentials. macOS relies on applications honoring proxy environment variables. Windows also configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's networking stack. Configure supported credentials in the separate `username` and `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, while an https:// or authenticated loopback URL uses the URL form.
14787+
/// HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, requires that endpoint to be reachable over IPv4 (the `[::]` dual-stack wildcard is accepted and routed through the IPv4 gateway), and does not support proxy credentials. macOS relies on applications honoring proxy environment variables. Windows also configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's networking stack. Configure supported credentials in the separate `username` and `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, while an https:// or authenticated loopback URL uses the URL form.
1478814788
#[serde(skip_serializing_if = "Option::is_none")]
1478914789
pub proxy: Option<SandboxConfigUserPolicyNetworkProxy>,
1479014790
}

rust/tests/e2e/rpc_session_state_extras.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ async fn should_update_and_clear_live_subagent_settings() {
495495
),
496496
effort_level: Some("low".to_string()),
497497
model: Some("gpt-5-mini".to_string()),
498+
model_policy: None,
498499
},
499500
)])),
500501
disabled_subagents: Some(vec!["legacy-agent".to_string()]),

scripts/codegen/rust.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,7 @@ function tryEmitRustUnion(
378378

379379
const lines: string[] = [];
380380
if (schema.description) {
381-
for (const line of schema.description.split(/\r?\n/)) {
382-
lines.push(`/// ${line}`);
383-
}
381+
pushRustDoc(lines, schema.description);
384382
}
385383
pushRustExperimentalDocs(lines, isSchemaExperimental(schema) || ctx.experimentalTypeNames.has(enumName));
386384
lines.push("#[derive(Debug, Clone, Serialize, Deserialize)]");
@@ -468,7 +466,8 @@ function pushRustExperimentalDocs(
468466

469467
function pushRustDoc(lines: string[], text: string | undefined, indent = ""): void {
470468
if (!text) return;
471-
for (const paragraph of text.trim().split(/\r?\n/)) {
469+
const sanitized = text.replace(/\[::\]/g, "`[::]`");
470+
for (const paragraph of sanitized.trim().split(/\r?\n/)) {
472471
if (paragraph.trim().length === 0) {
473472
lines.push(`${indent}///`);
474473
} else {
@@ -971,9 +970,7 @@ function emitRustStruct(
971970

972971
for (const { propName, prop, isReq, rustField, rustType } of fields) {
973972
if (prop.description) {
974-
for (const line of prop.description.split(/\r?\n/)) {
975-
lines.push(` /// ${line}`);
976-
}
973+
pushRustDoc(lines, prop.description, " ");
977974
}
978975
pushRustExperimentalDocs(lines, isSchemaExperimental(prop), " ");
979976
const propIsInternal = isSchemaInternal(prop);

0 commit comments

Comments
 (0)