Include terminal launch commands in Guardian stdin reviews (#57758)

## Why

Guardian's `write_stdin` approval requests lacked the command used to launch the receiving terminal, leaving reviews without that context.

## What changed

- Carry `original_command` from the terminal's launch command into the approval request and Guardian action JSON. This describes the original launch, not the terminal's current state.
- Exclude `original_command` from the 8,000-byte stdin approval size check so launch context does not consume the budget for input, permission details, and the approval reason. Launch context remains subject to Guardian's normal request budget.

## Testing

Extend serialization coverage to check `original_command` and the strict stdin review integration test to verify that a launch command longer than 8,000 bytes reaches Guardian intact.

GitOrigin-RevId: cc765a6bf80d080baf94c959eafa6227b2889e1f
This commit is contained in:
jif
2026-10-28 15:10:52 +00:00
committed by copyberry
parent fc916a22b5
commit 7c11b8074d
9 changed files with 41 additions and 13 deletions
+4
View File
@@ -82,6 +82,7 @@ pub(crate) enum ApprovalAction {
approval_id: String,
environment_id: String,
process_id: i32,
original_command: String,
input: String,
cwd: PathUri,
tty: bool,
@@ -182,6 +183,7 @@ impl ApprovalAction {
approval_id,
environment_id,
process_id,
original_command: _,
input,
cwd,
tty,
@@ -337,6 +339,7 @@ impl ApprovalAction {
approval_id,
environment_id,
process_id,
original_command,
input,
cwd,
tty,
@@ -348,6 +351,7 @@ impl ApprovalAction {
approval_id,
environment_id,
process_id,
original_command,
input,
cwd,
tty,