core-agent-ide/codex-rs/app-server/tests/suite/v2
Eric Traut 28bfbb8f2b
Enforce user input length cap (#12823)
Currently there is no bound on the length of a user message submitted in
the TUI or through the app server interface. That means users can paste
many megabytes of text, which can lead to bad performance, hangs, and
crashes. In extreme cases, it can lead to a [kernel
panic](https://github.com/openai/codex/issues/12323).

This PR limits the length of a user input to 2**20 (about 1M)
characters. This value was chosen because it fills the entire context
window on the latest models, so accepting longer inputs wouldn't make
sense anyway.

Summary
- add a shared `MAX_USER_INPUT_TEXT_CHARS` constant in codex-protocol
and surface it in TUI and app server code
- block oversized submissions in the TUI submit flow and emit error
history cells when validation fails
- reject heavy app-server requests with JSON-RPC `-32602` and structured
`input_too_large` data, plus document the behavior

Testing
- ran the IDE extension with this change and verified that when I
attempt to paste a user message that's several MB long, it correctly
reports an error instead of crashing or making my computer hot.
2026-02-25 22:23:51 -08:00
..
account.rs fix(app-server): for external auth, replace id_token with chatgpt_acc… (#11240) 2026-02-09 20:48:58 -08:00
analytics.rs Reapply "Add app-server transport layer with websocket support" (#11370) 2026-02-11 18:13:39 +00:00
app_list.rs [apps] Enforce simple logo url format. (#12374) 2026-02-20 22:05:55 +00:00
collaboration_mode_list.rs Enable request_user_input in Default mode (#12735) 2026-02-25 15:20:46 -08:00
compaction.rs Treat compaction failure as failure state (#10927) 2026-02-06 13:51:46 -08:00
config_rpc.rs [apps] Implement apps configs. (#12086) 2026-02-20 12:05:21 -08:00
connection_handling_websocket.rs codex-rs/app-server: graceful websocket restart on Ctrl-C (#12517) 2026-02-24 16:27:59 -08:00
connection_handling_websocket_unix.rs codex-rs/app-server: graceful websocket restart on Ctrl-C (#12517) 2026-02-24 16:27:59 -08:00
dynamic_tools.rs feat(app-server): add ThreadItem::DynamicToolCall (#12732) 2026-02-25 12:00:10 -08:00
experimental_api.rs Add app-server v2 thread realtime API (#12715) 2026-02-25 09:59:10 -08:00
experimental_feature_list.rs Agent jobs (spawn_agents_on_csv) + progress UI (#10935) 2026-02-24 21:00:19 +00:00
initialize.rs feat: opt-out of events in the app-server (#11319) 2026-02-10 18:04:52 +00:00
mod.rs Revert "Add skill approval event/response (#12633)" (#12811) 2026-02-26 01:02:42 +00:00
model_list.rs make 5.3-codex visible in cli for api users (#12808) 2026-02-25 13:01:40 -08:00
output_schema.rs Add text element metadata to types (#9235) 2026-01-14 16:41:50 -08:00
plan_item.rs chore: rm remote models fflag (#11699) 2026-02-17 11:43:16 -08:00
rate_limits.rs feat: support multiple rate limits (#11260) 2026-02-10 20:09:31 -08:00
realtime_conversation.rs Add app-server v2 thread realtime API (#12715) 2026-02-25 09:59:10 -08:00
request_user_input.rs Enable request_user_input in Default mode (#12735) 2026-02-25 15:20:46 -08:00
review.rs chore: remove codex-core public protocol/shell re-exports (#12432) 2026-02-20 23:45:35 -08:00
safety_check_downgrade.rs Chore: remove response model check and rely on header model for downgrade (#12061) 2026-02-18 01:50:06 +00:00
skills_list.rs feat: extend skills/list to support additional roots. (#10835) 2026-02-09 13:30:38 -08:00
thread_archive.rs feat(app-server): thread/unsubscribe API (#10954) 2026-02-25 13:14:30 -08:00
thread_fork.rs Add field to Thread object for the latest rename set for a given thread (#12301) 2026-02-20 18:26:57 -08:00
thread_list.rs feat: add search term to thread list (#12578) 2026-02-25 09:59:41 +00:00
thread_loaded_list.rs [chore] move app server tests from chat completion to responses (#8939) 2026-01-08 22:27:55 +00:00
thread_read.rs feat: add search term to thread list (#12578) 2026-02-25 09:59:41 +00:00
thread_resume.rs tests: centralize in-flight turn cleanup helper (#12271) 2026-02-20 01:47:34 +00:00
thread_rollback.rs Add field to Thread object for the latest rename set for a given thread (#12301) 2026-02-20 18:26:57 -08:00
thread_start.rs feat: add service name to app-server (#12319) 2026-02-25 09:51:42 +00:00
thread_status.rs app-server: expose loaded thread status via read/list and notifications (#11786) 2026-02-18 15:20:03 -08:00
thread_unarchive.rs Add field to Thread object for the latest rename set for a given thread (#12301) 2026-02-20 18:26:57 -08:00
thread_unsubscribe.rs feat(app-server): thread/unsubscribe API (#10954) 2026-02-25 13:14:30 -08:00
turn_interrupt.rs Fix test_shell_command_interruption flake (#10649) 2026-02-04 22:19:06 +00:00
turn_start.rs Enforce user input length cap (#12823) 2026-02-25 22:23:51 -08:00
turn_start_zsh_fork.rs fix: harden zsh fork tests and keep subcommand approvals deterministic (#12809) 2026-02-25 12:23:30 -08:00
turn_steer.rs Enforce user input length cap (#12823) 2026-02-25 22:23:51 -08:00
windows_sandbox_setup.rs app-server support for Windows sandbox setup. (#12025) 2026-02-18 13:03:16 -08:00