Repository navigation
Commit 3d82da8
committed
fix(mobile): prompt-last IPC layout so user
The old layout "generate|{prompt}|{max}|{temp}" + Kotlin
split("|", limit = 3) truncated the prompt the moment a user typed `|`,
and shoved whatever followed into max_tokens / temperature. On top of
the reliability bug, this was a parsing-injection vector: a crafted
prompt could silently coerce generation parameters.
Switch to "generate|{max}|{temp}|{prompt}" — prompt is the last slot,
so split keeps it intact as a single string (and the default 512 / 0.7
still apply if it's empty). Additionally strip NUL / CR / LF from the
prompt on the Rust side, as the file IPC uses newline-agnostic
read_to_string but the request parser does not.
Closes #11/21.| doesn't corrupt llm_gen1 parent 4ab6958 commit 3d82da8
2 files changed
Lines changed: 21 additions & 5 deletions
File tree
- packages/mobile/src-tauri
- gen/android/app/src/main/java/ai/opencode/mobile
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
199 | 203 | | |
200 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
201 | 207 | | |
202 | 208 | | |
203 | | - | |
204 | | - | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
273 | 279 | | |
274 | 280 | | |
275 | 281 | | |
| |||
280 | 286 | | |
281 | 287 | | |
282 | 288 | | |
283 | | - | |
284 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
285 | 297 | | |
286 | 298 | | |
287 | 299 | | |
| |||
0 commit comments