Skip to content

Conversation

@tibo-openai
Copy link
Collaborator

@tibo-openai tibo-openai commented Jan 5, 2026

Fixes inscrutable multiline approval requests by not proposing for them to be added to execpolicy. Example of prior failure (sent by a user):
image

@tibo-openai tibo-openai marked this pull request as ready for review January 5, 2026 23:48
@tibo-openai tibo-openai enabled auto-merge (squash) January 6, 2026 00:54
@tibo-openai tibo-openai changed the title fix: truncate long approval prefixes when rendering fix: do not propose to add multiline commands to execpolicy Jan 6, 2026
Copy link
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

let long = format!("python - <<'PY'\n{}\nPY\n", "x".repeat(500));
let args = vec!["bash".into(), "-lc".into(), long];
let label = render_for_approval_prefix_label(&args);
assert!(!label.contains('\n'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I would just do the work to derive expected_label and then assert_eq!(expected_label, label) because then the failure of the assertion has a stronger signal and the difference should be pretty clear when the failure is printed.

That said, this is pretty low-risk, so you can also keep it as-is.

@tibo-openai tibo-openai merged commit 8b4d27d into main Jan 6, 2026
26 checks passed
@tibo-openai tibo-openai deleted the tibo/approval-truncation branch January 6, 2026 23:17
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants