Repository navigation
feat(ui): add safe submission escape hatch - #66
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (18)
📝 WalkthroughSummary by CodeRabbit
WalkthroughSubmitted messages now pass through pre-dispatch cancellation, draw and persistence gates. Queued submissions preserve full input data, survive session restoration, support short Escape-based recovery, and use revision-aware storage ordering. ChangesSubmission lifecycle
Estimated code review effort: 5 (Critical) | ~120 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e209b46d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !rt.app.accepts_submission_persistence(&completion.dispatch) { | ||
| rt.app | ||
| .queue | ||
| .remove_submission(completion.dispatch.submission_id); | ||
| return; |
There was a problem hiding this comment.
Persist the restored state after rejecting a saved dispatch
When an Escape restore wins after the persistence job has already written the gated snapshot, this branch runs because the dispatch is no longer accepted, but it only removes the in-memory queue item. The just-written session still contains the hidden queued_submissions entry (and not the restored input draft), so a crash before some later save will resurrect and send the message that the user already restored for editing.
Useful? React with 👍 / 👎.
| return false; | ||
| } | ||
|
|
||
| self.queue.remove_submission(submission_id); |
There was a problem hiding this comment.
Keep restore from unblocking stale queued turns
When the user restores the first paint-gated submission while another turn-end item is already queued behind it (for example via Tab or a session API prompt during the 2.5s window), removing only this submission makes the later ready item the queue head. The app then increments run_id and goes idle, but the agent loop can still pop and send that stale queued item to the provider, with its events filtered as stale and potentially persisted from shared history later.
Useful? React with 👍 / 👎.
Resolve merge conflicts by integrating main's OpenAiOptions refactoring with the PR's safe submission escape hatch logic. Changes: - n00n-ui/src/agent/agent_loop.rs: Add openai_options field and parameter, pass to resolve_compaction_model and AgentParams - n00n-ui/src/event_loop.rs: Add openai_options to EventLoopParams and SpawnCtx, use from_model_with_openai_options throughout, fix API call signatures (transition_plan, pick_model_for_lua, spawn_shell, start_btw) - Preserve PR's pre_dispatch_gate and stage_submission_preamble logic
Resolve merge conflicts by integrating main's OpenAiOptions refactoring with the PR's safe submission escape hatch logic. Changes: - n00n-ui/src/agent/agent_loop.rs: Add openai_options field and parameter, pass to resolve_compaction_model and AgentParams - n00n-ui/src/event_loop.rs: Add openai_options to EventLoopParams and SpawnCtx, use from_model_with_openai_options throughout, fix API call signatures (transition_plan, pick_model_for_lua, spawn_shell, start_btw) - Preserve PR's pre_dispatch_gate and stage_submission_preamble logic
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Criterion
Details
| Benchmark suite | Current: 45d49f1 | Previous: 6d2fdd1 | Ratio |
|---|---|---|---|
fib/jit_mlua_hook |
6439394 ns/iter (± 187660) |
7958148 ns/iter (± 273463) |
0.81 |
fib/jit_watchdog |
2494311 ns/iter (± 27053) |
2209761 ns/iter (± 5772) |
1.13 |
fib/jit_none |
2363944 ns/iter (± 29366) |
2274300 ns/iter (± 14767) |
1.04 |
fib/interp_mlua_hook |
7604957 ns/iter (± 39953) |
8778073 ns/iter (± 146298) |
0.87 |
fib/interp_watchdog |
3774703 ns/iter (± 32638) |
3555445 ns/iter (± 17892) |
1.06 |
fib/interp_none |
3675183 ns/iter (± 8839) |
3550878 ns/iter (± 4757) |
1.04 |
buffer_rw/jit_mlua_hook |
555176 ns/iter (± 2130) |
802983 ns/iter (± 1062) |
0.69 |
buffer_rw/jit_watchdog |
167807 ns/iter (± 228) |
108497 ns/iter (± 958) |
1.55 |
buffer_rw/jit_none |
167675 ns/iter (± 248) |
108496 ns/iter (± 191) |
1.55 |
buffer_rw/interp_mlua_hook |
1067914 ns/iter (± 34953) |
1150234 ns/iter (± 17243) |
0.93 |
buffer_rw/interp_watchdog |
641364 ns/iter (± 11430) |
496528 ns/iter (± 1622) |
1.29 |
buffer_rw/interp_none |
643807 ns/iter (± 8279) |
496680 ns/iter (± 2076) |
1.30 |
splash_render_120x40 |
73965 ns/iter (± 2447) |
63094 ns/iter (± 165) |
1.17 |
splash_render_200x60 |
103569 ns/iter (± 14812) |
113709 ns/iter (± 10576) |
0.91 |
This comment was automatically generated by workflow using github-action-benchmark.
Summary
Paints submitted messages before persistence/provider startup and adds a 2.5-second Escape window that restores text and images only when cancellation wins before any request can be sent. Adds FIFO, crash-recovery, MCP, shell-context, and compaction-safe persistence semantics.
Type
Changelog fragment
changelog.d/submission-escape-hatch.added.mdTest plan
cargo test -p n00n-agent -p n00n-ui -p n00n-storageAI use
N/A.