Skip to content

Fix Codex action recipe submit key - #18996

Open
Pr1p wants to merge 9 commits into
stablyai:mainfrom
Pr1p:fix/ai-recipe-codex-submit-key
Open

Pr1p wants to merge 9 commits into
stablyai:mainfrom
Pr1p:fix/ai-recipe-codex-submit-key

Conversation

@Pr1p

@Pr1p Pr1p commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When Orca pastes an Action Recipe prompt into Codex, it now keeps the normal Enter-to-submit behavior by default. If a user has configured Codex so Ctrl+Enter submits instead, Orca can be told to use Ctrl+Enter for that agent, and it only sends the special terminal bytes when the pane has proven it can understand them.

What Changed

  • Added a per-agent post-paste submit key setting, defaulting to Enter.
  • Added a Settings > Agents control for choosing Enter or Ctrl+Enter per agent.
  • Removed the hardcoded Codex Ctrl+Enter submit input from the agent catalog.
  • Reused shared Enter / Ctrl+Enter CSI-u terminal input constants.
  • Registered kitty keyboard mode trackers by PTY id so paste-submit can fall back to Enter when CSI-u is not active for the target pane.
  • Reused the resolved submit input for Codex's post-paste retry path.
  • Passed the automation agent id through reused-session prompt submission so reused Codex sessions follow the configured behavior.
  • Updated paste/chunking tests, including bracketed-paste control sequence assertions and Ctrl+Enter fallback coverage.

Why

Codex submit is user-configurable. The default Codex binding submits with Enter, while some users remap submit to Ctrl+Enter so Enter can insert newlines. A hardcoded Codex Ctrl+Enter fixed the remapped case but would regress default users. Keeping this as an explicit per-agent setting preserves the default and lets remapped users opt in.

The kitty fallback also avoids sending CSI-u bytes to panes that have not negotiated the keyboard protocol.

Linked Issue

Fixes #18825

Visual Proof

UI change present: Settings > Agents now has a Paste-submit key segmented control with Enter and Ctrl+Enter.

Screenshot not captured in this turn because the local $electron validation skill required by this repository was not available in the current Codex environment. The screenshot checklist item below is intentionally left unchecked until a follow-up run or reviewer attaches visual proof.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Local checks run on the rebased branch:

  • ./node_modules/.bin/vitest.CMD run --config config/vitest.config.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-draft-paste-content-chunking.test.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/renderer/src/components/terminal-pane/terminal-pty-kitty-keyboard-flags.test.ts
  • git diff --check origin/main...HEAD

Notes:

  • The global pnpm shim failed in this environment, so repository-local binaries/direct Node commands were used where possible.
  • Full typecheck / changed-code quality were attempted after rebasing, but the Windows process stalled without diagnostics before completion; CI should provide the authoritative full validation.

AI Disclosure

Implemented with ChatGPT/Codex assistance under human direction.

Review

Ready for maintainer review. This update addresses the Pullfrog default-Codex regression, the CSI-u fallback issue, and the CodeRabbit bracketed-paste test assertion.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security impact is limited to selecting PTY input bytes after an already-authorized paste. Enter remains the default for all agents. Ctrl+Enter emits CSI-u only when configured and the target PTY has proven kitty keyboard flags; local, remote, WSL, and SSH delivery still flow through the existing PTY input path.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Walkthrough

Settings now support a per-agent choice of Enter or Ctrl+Enter, and the local agent settings interface can save that choice. The paste submission path uses the configured input and the PTY’s Kitty keyboard flags for both the initial submit and any retry. PTY keyboard tracking includes registration, retained flags, and reattachment handling. Automation dispatch now passes the selected agent ID to prompt submission.

Estimated code review effort:

Severity of issue fixed: Medium

Merge Risk: Minimal · previous review 46a2a

The submit-key settings changes are mergeable after normal checks; no actionable current-head risk was established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 6f132

The configurable behavior remains limited to fixed submit keys sent to existing terminal sessions. No privilege expansion was established, but behavior across session replacement and delayed submission has not been fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new preference can affect submission behavior across sessions for a configured agent, but each operation still targets an explicit PTY and selects between fixed terminal sequences. The inspected change does not make the preference an arbitrary-command or runtime-destination selector.

Trust Boundaries and Controls

  • observed — The renderer sender preserves owner-derived remote routing and handles an explicit terminal-gone failure as unsuccessful delivery. This establishes destination routing, but does not establish provider-side rejection of a stale handle reused within the same environment.

Resilience and Maintainability Implications

  • inferred — The capability cache and delayed submission depend on PTY identity remaining valid across asynchronous lifecycle changes. Retained snapshots and captured retry inputs are visible, but an end-to-end stale-identity attack path was not established. Registration reset and owner-derived routing are meaningful counterevidence; destruction cleanup, same-environment handle reuse, and cancellation remain unresolved.

Hardening Proposals

  • proposed — If PTY identifiers can be reused, bind retained capability state and delayed submission to a session incarnation, preserving parked-pane state only for that same incarnation. Confirm cancellation and replacement behavior before treating this as necessary remediation.
Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "Fix Codex action recipe submit key" names the primary change: the Codex action recipe paste-submit key is now resolved per agent (Enter by default, or Ctrl+Enter when configured) instead of…
Description check Passed The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #18825), Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes…
Linked Issues check Passed Issue [#18825] requires Action Recipe submission to use the selected agent submit key and requires the post-paste retry to use that key. The PR adds per-agent Enter or Ctrl+Enter settings with Enter a…
Out of Scope Changes check Passed The changes support [#18825]. Settings types, defaults, normalization, persistence, and the Settings > Agents control implement the per-agent submit-key configuration. Shared terminal input constants …
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Full details: Title check

Explanation

The title "Fix Codex action recipe submit key" names the primary change: the Codex action recipe paste-submit key is now resolved per agent (Enter by default, or Ctrl+Enter when configured) instead of a hardcoded Codex Ctrl+Enter. The changeset covers that setting, the Settings > Agents control, the Kitty keyboard fallback, and the retry and reused-session paths, so the title is related to the main change. It is short and specific, and it avoids vague terms.

Full details: Description check

Explanation

The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #18825), Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. The What Changed and Why sections explain the before and after behavior and the mechanism. Visual Proof is incomplete: the UI control is described, but no before/after screenshot or video is attached and no reason is given beyond the unavailable validation skill. The Testing section lists targeted test commands but not a full lint, typecheck, test, or build pass. These gaps are non-critical relative to the rest of the template, so the description is mostly complete.

Full details: Linked Issues check

Explanation

Issue [#18825] requires Action Recipe submission to use the selected agent submit key and requires the post-paste retry to use that key. The PR adds per-agent Enter or Ctrl+Enter settings with Enter as the default. The paste flow resolves the configured input, uses it for the initial submission and retry, and sends Ctrl+Enter CSI-u only when the target PTY reports Kitty keyboard mode. The reused-session path now receives the agent ID. Tests cover active and inactive Kitty keyboard mode. The separate readiness issue [#13439] is not a requirement of [#18825].

Full details: Out of Scope Changes check

Explanation

The changes support [#18825]. Settings types, defaults, normalization, persistence, and the Settings > Agents control implement the per-agent submit-key configuration. Shared terminal input constants and PTY Kitty keyboard tracking implement safe Ctrl+Enter delivery. Readiness helper extraction supports the paste flow. Reattach tracking preserves the PTY capability state needed by that flow. The automation dispatch change passes the agent ID required for reused-session submission. The added tests cover these behaviors. No unrelated change is demonstrated.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c262b9a0-5756-4913-9983-86da954239c8
Commits

Reviewing files that changed from the base of the PR and between edf067a and 46a2a1f.

Files selected for processing: 2

  • src/renderer/src/components/settings/AgentLaunchSettingsSection.test.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsSection.tsx
Files skipped from review as they are similar to previous changes: 2

  • src/renderer/src/components/settings/AgentLaunchSettingsSection.test.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsSection.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 04f4d133-0f41-4f49-8cee-1cbc5e849085

📥 Commits

Reviewing files that changed from the base of the PR and between 681119d and 1056ba4047718c066ea9a04a3f9f8d9d7d5c9030.

📒 Files selected for processing (6)
  • src/renderer/src/hooks/automation-dispatch-handler.ts
  • src/renderer/src/lib/agent-draft-paste-content-chunking.test.ts
  • src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/shared/tui-agent-config.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

This fixes the reported Ctrl+Enter=submit case but regresses default Codex users: Codex's default submit key is plain Enter, and Ctrl+Enter is unbound by default, so sending \x1b[13;5u unconditionally will leave the prompt in the composer for anyone who has not remapped Codex.

Reviewed changes

  • Agent-level post-paste submit input — adds AgentPostPasteSubmitInput (enter | ctrl-enter) and a postPasteSubmitInput config field, set to ctrl-enter for Codex.
  • Submit input threading — submitPromptToAgentPty gains an agent param; automation-dispatch-handler.ts passes automation.agentId on reused sessions; sendBracketedPasteToRunningAgent also accepts agent.
  • Submit/retry reuse — resolvePostPasteSubmitInput selects \r or \x1b[13;5u, reused for both the initial submit and the blind retry.
  • Test reorganization — chunking tests move into agent-draft-paste-content-chunking.test.ts to keep the touched test file under the max-lines limit; submit assertions update to the agent-specific bytes.

⚠️ Submit key is a per-user Codex setting, not an agent constant

The design hardcodes ctrl-enter as Codex's submit input, but Codex's submit binding is user configuration. The default is Enter (tui.keymap.composer.submit = ["enter", "ctrl-m"]); Ctrl+Enter only submits when the user has explicitly remapped it. This needs a decision on how Orca learns the user's actual binding before it can ship without regressing default users.

Technical details
# Submit key is user configuration, not an agent constant

## Affected sites
- src/shared/tui-agent-config.ts:109 — `postPasteSubmitInput: 'ctrl-enter'` hardcodes Codex's submit as Ctrl+Enter
- src/renderer/src/lib/agent-paste-draft.ts:250 — `resolvePostPasteSubmitInput` maps the config to `\x1b[13;5u` unconditionally
- src/renderer/src/lib/agent-paste-draft.ts:230,237 — initial submit and blind retry both use the resolved input

## Required outcome
- Submitting a pasted Codex prompt must use the key the user's Codex is actually bound to (Enter by default, Ctrl+Enter only when remapped). The current hardcoded `ctrl-enter` fixes the remapped case but breaks the default case.

## Suggested approach (optional)
- Detect the user's Codex composer submit binding (e.g. read `tui.keymap.composer.submit` from `~/.codex/config.toml`) and derive the submit input from it, falling back to Enter.
- Alternatively expose a per-recipe or per-agent submit-key setting, defaulting to Enter.

## Open questions for the human (optional)
- Is reading Codex config acceptable, or should this be a user-facing setting?

ℹ️ Nitpicks

  • \x1b[13;5u is already defined in terminal-shortcut-policy.ts and the ctrlEnterEncoding: 'csi-u' capability already encodes "this agent decodes CSI-u Ctrl+Enter" (terminal-ctrl-enter.ts). The new postPasteSubmitInput field plus POST_PASTE_CTRL_ENTER_INPUT duplicates both the byte constant and the capability concept — consider centralizing the CSI-u byte or reusing the existing capability.
  • The PR's "manually tested locally" box is unchecked; the load-bearing assumption (that Codex decodes \x1b[13;5u as submit) is exactly what turned out to be wrong, so a real-Codex check would have caught this.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Comment thread src/shared/tui-agent-config.ts Resolved
@Pr1p
Pr1p force-pushed the fix/ai-recipe-codex-submit-key branch from 1056ba4 to 0d8eaab Compare September 6, 2026 15:03
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Removed the hardcoded Codex ctrl-enter submit — postPasteSubmitInput: 'ctrl-enter' is gone from tui-agent-config.ts, restoring Enter as the default so default-configured Codex keeps submitting.
  • Added a per-agent agentPostPasteSubmitInputs setting — an Enter / Ctrl+Enter segmented control in Settings → Agents, with normalization on load and update and an empty default record.
  • Extracted shared terminal input constants — TERMINAL_ENTER_INPUT / TERMINAL_CTRL_ENTER_CSI_U_INPUT plus resolveTerminalCtrlEnterInput in terminal-ctrl-enter-input.ts, now reused by terminal-shortcut-policy.ts and codex-tui-rollout-proof.ts.
  • Gated CSI-u on per-PTY kitty negotiation — registered the pane's TerminalKittyKeyboardModeTracker by PTY id and routed resolvePostPasteSubmitSequence through getPtyKittyKeyboardFlags(ptyId), falling back to Enter when the pane hasn't negotiated the kitty protocol.
  • Threaded the agent through submit paths — submitPromptToAgentPty / sendBracketedPasteToRunningAgent accept agent, and reused-session automation dispatch passes automation.agentId.
  • Reorganized tests — chunking assertions moved into agent-draft-paste-content-chunking.test.ts, with new Ctrl+Enter and fallback coverage.

The two prior review threads (default-Codex regression, missing kitty gate) are both resolved by these commits, and the duplication nitpick is closed out by the shared constants module. The per-PTY tracker wiring is correct — session.kittyKeyboardModes is fed live PTY output in write-pty-output-to-xterm.ts, so getPtyKittyKeyboardFlags reflects the application's actual negotiation state, and the empty-registry fallback degrades safely to Enter for unregistered PTYs.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@Pr1p

Pr1p commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

Merged latest main and resolved the conflict.

The only conflict was src/main/codex/codex-tui-rollout-proof.ts (modify/delete): main removed that file in #22783 along with the unused terminal-handoff path, and nothing on main references it anymore. Accepted the deletion — this PR's behavioral change lives in the shared TERMINAL_ENTER_INPUT constant and its usages (agent-paste-draft.ts, terminal-shortcut-policy.ts), which all merged cleanly.

Verification: node + web typecheck pass; targeted suites (agent-paste-draft, tui-agent-config, source-control-ai-recipe-save) — 40 tests green.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 7531905d-2355-4bd9-8af1-119acd52cfbf

📥 Commits

Reviewing files that changed from the base of the PR and between 0d8eaab and aa4156d42858af8de7c2d0c0a85b620dad1d0b4f.

📒 Files selected for processing (9)
  • src/main/persistence/loading-store/normalize-loaded-global-settings.ts
  • src/renderer/src/components/terminal-pane/pty-connection/terminal-keydown-fit.ts
  • src/renderer/src/hooks/automation-dispatch-handler.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/renderer/src/store/slices/settings.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
  • src/shared/tui-agent-config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/shared/tui-agent-config.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@Pr1p
Pr1p force-pushed the fix/ai-recipe-codex-submit-key branch from aa4156d to 6f1324c Compare October 4, 2026 08:17

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Re-merged origin/main and re-resolved the settings rows — the conflict-resolving merge also reworked Input into a CVA variant (default / compact-mono) and moved the launch-default inputs off their ad-hoc h-7 font-mono text-xs class strings onto that variant.
  • Retained proven Kitty flags across PTY unbind — unregisterPtyKittyKeyboardModeTracker now snapshots the tracker's snapshotFlags under the PTY id, so a parked or rebound pane can still resolve Ctrl+Enter instead of silently degrading to Enter. Register clears the retained entry, and the guarded unregister still refuses to clobber a successor tracker.
  • Extracted the PTY readiness helpers — waitForAgentDraftInputReadyOnTab and waitForExpectedAgentOnPty moved verbatim into agent-draft-pty-readiness.ts, replacing the duplicate copies the conflicting merge had left inside agent-paste-draft.ts.
  • Threaded inputKind through the submit paths — submitPromptToAgentPty and sendBracketedPasteToRunningAgent now pass 'driving', and resolvePostPasteSubmitSequence gates CSI-u on getPtyKittyKeyboardFlags(ptyId) with the retained fallback.
  • Inlined the submit-input union into GlobalSettings — agentPostPasteSubmitInputs uses 'enter' | 'ctrl-enter' directly, avoiding the tui-agent-post-paste-submit → tui-agent-config runtime cycle that importing AgentPostPasteSubmitInput would create.

Verified locally: the four changed test files pass (45 tests) and check:code-quality:changed reports 0 findings against origin/main, including the design-system scan on the Input variant refactor.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@Pr1p

Pr1p commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Merged current main and resolved the shared settings-normalization conflict by retaining both agentPostPasteSubmitInputs and normalizePluginThemeSettings.

Verified: focused draft-submission suites (42 tests), web typecheck, oxfmt --check, and oxlint.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] Adds agent recipe submission key configuration to settings.

The PR is not yet safe to merge because a cross-writer publication invalidation can still cause a later submit-key save to erase an earlier acknowledged selection.

Findings

  1. P1 Stale publication still erases settings ▶

Summary

This PR adds configurable Enter or Ctrl+Enter post-paste submission, tracks kitty keyboard support per PTY, and routes the resolved input through initial and retry submissions. The settings-save repair remains incomplete because serialized writes do not carry acknowledged state across publication-fence invalidation.

  • Adds per-agent submit-key persistence and Settings UI controls.
  • Falls back to Enter unless the target PTY has established CSI-u support.
  • Preserves submit behavior for reused automation sessions and retry paths.
  • Adds focused settings, terminal-tracking, and paste-submission tests.

Diagram

sequenceDiagram
  participant Q as Settings write queue
  participant S as Renderer store
  participant P as Persistence
  participant O as Other settings operation
  Q->>S: Read submit-key map
  Q->>P: Persist first selection
  O->>S: Advance publication generation
  P-->>Q: Acknowledge persisted settings
  P--xS: Publication rejected by stale fence
  Q->>S: Read stale map for next save
  Q->>P: Persist replacement map
  Note over P: First acknowledged selection is removed
Loading

Reviews (5) · Last reviewed commit: "merge: update PR 18996 with main" · Reviewed by Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b68ec1d-db18-4a51-bdb0-ee635c406a01
Commits

Reviewing files that changed from the base of the PR and between 41898d5 and 132e354.

Files selected for processing: 14
  • src/main/persistence/loading-store/normalize-loaded-global-settings.ts
  • src/renderer/src/components/settings/AgentCatalogRow.tsx
  • src/renderer/src/components/settings/AgentLaunchDefaultsEditor.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsCatalog.tsx
  • src/renderer/src/components/terminal-pane/pty-connection/terminal-keydown-fit.ts
  • src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts
  • src/renderer/src/hooks/automation-dispatch-handler.ts
  • src/renderer/src/lib/agent-draft-pty-readiness.ts
  • src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/renderer/src/store/slices/settings.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@Pr1p

Pr1p commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the current review findings in 23d061f.

  • Serialise local submit-key updates through the existing settings queue, so rapid changes for different agents preserve both selections.
  • Give each PTY keyboard-mode registration an ownership token, so cleanup from an earlier session cannot remove a successor that shares its tracker.

Added focused regression coverage. Verified with 50 focused tests, oxfmt --check, and oxlint.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11a956c4-5a0e-479d-ae0a-c19d184f200c
Commits

Reviewing files that changed from the base of the PR and between 132e354 and 23d061f.

Files selected for processing: 6
  • src/renderer/src/components/settings/AgentLaunchSettingsCatalog.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsSection.test.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsSection.tsx
  • src/renderer/src/components/terminal-pane/pty-connection/terminal-keydown-fit.ts
  • src/renderer/src/components/terminal-pane/terminal-pty-kitty-keyboard-flags.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pty-kitty-keyboard-flags.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@Pr1p

Pr1p commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Addressed both follow-up review findings in 74d5768.\n\n- Keep local launch-setting writes serialized across a local/remote settings remount, so concurrent agent submit-key choices do not overwrite one another.\n- Restore a previously proven Kitty keyboard mode only for the same PTY's replay reattachment, then reconcile it against ordered replay bytes; fresh PTYs do not inherit retained state.\n\nVerified: web typecheck, oxfmt --check, oxlint, and 68 focused tests (1 platform-gated test skipped).\n\n@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

@Pr1p Thanks for the update. I’ll review commit 74d57687db, focusing on settings-write serialization across remounts and same-PTY Kitty keyboard-mode restoration during replay.

I’ve noted your reported check results: web typecheck, formatting, lint, and 68 focused tests, with one platform-gated test skipped.


🧠 Learnings used
Learnt from: Jinwoo-H
Repo: stablyai/orca PR: 23483
File: src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts:0-0
Timestamp: 2026-09-28T05:00:56.127Z
Learning: In `src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts`, `session.kittyKeyboardModes` tracks the application's negotiated Kitty keyboard flags, not only bytes parsed by the current xterm instance. After confirmed shell foreground, scan `POST_REPLAY_REATTACH_RESET` even if `replayIntoTerminal` skips a certified-dead terminal write. The remount snapshot path re-seeds the tracker through `resetForSnapshot()` and `restoreSnapshotFlags()`.
Learnt from: Jinwoo-H
Repo: stablyai/orca PR: 23483
File: src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts:0-0
Timestamp: 2026-09-28T05:20:10.438Z
Learning: In `src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts`, `session.kittyKeyboardModes` tracks the application's negotiated Kitty keyboard flags. After confirmed shell foreground, scan `POST_REPLAY_REATTACH_RESET` even if `replayIntoTerminal` skips a certified-dead terminal write. The tracker persists across remounts through `paneKittyKeyboardModesRef`. `restoreSnapshotFlags()` runs only when a snapshot contains Kitty flags and a sequence number; otherwise, including relay replay, the tracker retains its state and scans replayed output.

If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

⚠️ Action not completed

Head commit changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Pr1p

Pr1p commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Synced latest main in 6125c7d and resolved the only conflict by retaining both the new shared argument-choice chips and this PR's post-paste submit-key control. The control now lives in its own component to keep the existing editor below its enforced line limit.\n\nVerification: 91 focused tests passed (1 platform-gated test skipped), plus oxfmt and oxlint. The two failing AgentLaunchDefaultsEditor checks reproduce with files identical to current main, so they are an upstream baseline failure rather than a PR regression.\n\n@coderabbitai resume\n@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

@Pr1p I’ll resume automatic reviews and request a review of the updated PR, including the conflict resolution in 6125c7dd19.

You report 91 focused tests passed, one platform-gated test skipped, and passing oxfmt and oxlint checks. I’ll treat the two AgentLaunchDefaultsEditor failures as reported baseline failures pending verification.


🧠 Learnings used
Learnt from: CR
Repo: stablyai/orca PR: 0
File: docs/STYLEGUIDE.md:0-0
Timestamp: 2026-10-21T01:10:45.334Z
Learning: Applicability reference:
AGENTS.md: # Design System
All UI work — layout, color, typography, spacing, component selection, UX behavior — must follow [`docs/STYLEGUIDE.md`](./docs/STYLEGUIDE.md). Use the tokens defined in `src/renderer/src/assets/main.css` (the canonical source) and the shadcn primitives in `src/renderer/src/components/ui/`. Don't invent new color values, font sizes, or shadow tiers when a documented one already covers the role. When STYLEGUIDE.md is silent, follow the resolution order in its final section.

Source excerpt:
# Orca UI Style Guide

## UX rules

### Screen UX review rubric

#### What to judge

- **Default focus:** dialogs, popovers, and command surfaces should focus the field or primary action the user is most likely to use. If Enter submits, focus must land where Enter triggers the intended primary action. Esc should back out without adding visual noise to Cancel/Dismiss.
Learnt from: CR
Repo: stablyai/orca PR: 0
File: docs/STYLEGUIDE.md:0-0
Timestamp: 2026-10-21T01:10:45.334Z
Learning: Applicability reference:
AGENTS.md: # Design System
All UI work — layout, color, typography, spacing, component selection, UX behavior — must follow [`docs/STYLEGUIDE.md`](./docs/STYLEGUIDE.md). Use the tokens defined in `src/renderer/src/assets/main.css` (the canonical source) and the shadcn primitives in `src/renderer/src/components/ui/`. Don't invent new color values, font sizes, or shadow tiers when a documented one already covers the role. When STYLEGUIDE.md is silent, follow the resolution order in its final section.

Source excerpt:
# Orca UI Style Guide

## Components

### Keyboard shortcut chips

**The label MUST match the actual binding for the platform.** If the keyboard handler reads `metaKey` on Mac and `ctrlKey` elsewhere, the chip must show `⌘` on Mac and `Ctrl` elsewhere. Mismatched chips are worse than no chip.
Learnt from: CR
Repo: stablyai/orca PR: 0
File: docs/STYLEGUIDE.md:0-0
Timestamp: 2026-10-21T01:10:45.334Z
Learning: Applicability reference:
AGENTS.md: # Design System
All UI work — layout, color, typography, spacing, component selection, UX behavior — must follow [`docs/STYLEGUIDE.md`](./docs/STYLEGUIDE.md). Use the tokens defined in `src/renderer/src/assets/main.css` (the canonical source) and the shadcn primitives in `src/renderer/src/components/ui/`. Don't invent new color values, font sizes, or shadow tiers when a documented one already covers the role. When STYLEGUIDE.md is silent, follow the resolution order in its final section.

Source excerpt:
# Orca UI Style Guide

## Components

### Keyboard shortcut chips

Use **`<ShortcutKeyCombo />`** from `src/renderer/src/components/ShortcutKeyCombo.tsx`. It renders a consistent key-cap style and inserts a `+` separator on Windows/Linux (Mac shows adjacent glyphs, no separator). It does **not** transform key strings — the _caller_ picks the platform-appropriate labels and passes them in:

```tsx
const isMac = navigator.userAgent.includes('Mac')
const mod = isMac ? '⌘' : 'Ctrl'
const shift = isMac ? '⇧' : 'Shift'
<ShortcutKeyCombo keys={[mod, shift, 'N']} />
```
✅ Action performed

Reviews resumed.


Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026

Copy link
Copy Markdown

Comments Outside Diff

These findings could not be posted inline.

  • P1 Acknowledged settings remain stale src/renderer/src/components/settings/AgentLaunchSettingsSection.tsx:119 ▶

    When another settings operation invalidates the publication fence while a queued submit-key save awaits persistence, the save is acknowledged without updating the renderer store. The next queued operation rebuilds the complete agentPostPasteSubmitInputs map from that stale store instead of the acknowledged settings returned by write, causing the earlier agent selection to be removed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ffa4ec6e-72ca-43bb-b3f6-b6f8f4c031dc
Commits

Reviewing files that changed from the base of the PR and between 23d061f and 6125c7d.

Files selected for processing: 13
  • src/main/persistence/loading-store/normalize-loaded-global-settings.ts
  • src/renderer/src/components/settings/AgentCatalogRow.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsSection.test.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsSection.tsx
  • src/renderer/src/components/settings/AgentPostPasteSubmitInputControl.test.tsx
  • src/renderer/src/components/settings/AgentPostPasteSubmitInputControl.tsx
  • src/renderer/src/components/terminal-pane/pty-connection/reattach-result-handler-park-reveal-verdict.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection/reattach-result-handler.ts
  • src/renderer/src/components/terminal-pane/pty-connection/terminal-keydown-fit.ts
  • src/renderer/src/components/terminal-pane/terminal-pty-kitty-keyboard-flags.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pty-kitty-keyboard-flags.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Retain the proven Kitty flags when replacing a PTY… · terminal-pty-kitty-keyboard-flags.ts:9-19

src/renderer/src/components/terminal-pane/terminal-pty-kitty-keyboard-flags.ts:9-19
Minor · Functional Correctness · Quick win

Retain the proven Kitty flags when replacing a PTY tracker.

A restored layout can give the same PTY ID to two distinct panes. Each pane creates its own tracker. The restored reattach path can then call setPanePtyFitBinding, which overwrites the PTY registration before the first pane cleans up. If the replacement replay has no Kitty mode sequence, its flags remain unproven. Configured Ctrl+Enter then falls back to Enter.

Retain the previous proven snapshot before replacing the registration:

Suggested fix
 export function registerPtyKittyKeyboardModeTracker(
   ptyId: string,
   tracker: TerminalKittyKeyboardModeTracker
 ): symbol {
   const token = Symbol(ptyId)
+  const previous = ptyKittyKeyboardModeTrackers.get(ptyId)
+  if (previous?.tracker.hasProvenBaseline) {
+    const snapshotFlags = previous.tracker.snapshotFlags
+    if (snapshotFlags !== undefined) {
+      retainedPtyKittyKeyboardFlags.set(ptyId, snapshotFlags)
+    }
+  }
   ptyKittyKeyboardModeTrackers.set(ptyId, { tracker, token })
   return token
 }

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 36966da8-e81f-4699-b1f2-262e7c7704ba
Commits

Reviewing files that changed from the base of the PR and between 6125c7d and edf067a.

Files selected for processing: 4
  • src/renderer/src/components/settings/AgentLaunchSettingsSection.test.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsSection.tsx
  • src/renderer/src/components/settings/AgentPostPasteSubmitInputControl.test.tsx
  • src/renderer/src/components/settings/AgentPostPasteSubmitInputControl.tsx
Files skipped from review as they are similar to previous changes: 2
  • src/renderer/src/components/settings/AgentPostPasteSubmitInputControl.test.tsx
  • src/renderer/src/components/settings/AgentPostPasteSubmitInputControl.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@Pr1p
Pr1p force-pushed the fix/ai-recipe-codex-submit-key branch from 46a2a1f to c538dfe Compare November 3, 2026 20:36
@Pr1p
Pr1p requested a review from brennanb2025 as a code owner November 3, 2026 20:36
Pr1p and others added 9 commits November 6, 2026 03:42
…talog

Main regrouped the settings components (settings/agents/launch/), so the
post-paste submit-input control lands at the new catalog-row path. The
settings group follows GlobalSettingsBase feature-module ownership, and
the catalog strings land in en.json.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Pr1p
Pr1p force-pushed the fix/ai-recipe-codex-submit-key branch from c538dfe to c5470f6 Compare November 5, 2026 20:05

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AI Action Recipes always submit with Enter and fail when Codex Submit is bound to Ctrl+Enter

1 participant