Commit 578c2ea
committed
fix(sandbox): escape C1 controls in visible session label + cover both paths
The prior change extended hasUnsafeControlChars (which gates the explain
command to an agent-only fallback) through the C1 range. But the parallel
visible Session-label path went through escapeControlCharsVisible, which only
escaped C0/DEL, so a C1 byte (e.g. U+009B CSI) in a redacted session key still
reached the single-line Session output raw.
Extend the shared escapeControlCharsVisible contract through C1 (0x80-0x9f)
so the visible label escapes those bytes too, and add an end-to-end regression
in sandbox-explain.test.ts asserting a C1-bearing session key both escapes in
the Session line and triggers the agent-only explain fallback.
Signed-off-by: lsr911 <[email protected]>1 parent ed5d522 commit 578c2ea
2 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
170 | 205 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
0 commit comments