feat: per-thread Codex args overrides with runtime sync (incl. no-thread fallback)#443
feat: per-thread Codex args overrides with runtime sync (incl. no-thread fallback)#443quippy-dev wants to merge 7 commits intoDimillian:mainfrom
Conversation
Fixes pre-existing lint findings (not introduced by this branch):\n- react-hooks exhaustive-deps in DesktopLayout\n- unnecessary callback dependency/unused param in useThreadMessaging\n- no-useless-escape in codexArgsProfiles
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f5ea95a7d
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fef7d38cca
ℹ️ 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".
| resolvedEffort, | ||
| accessMode, | ||
| selectedCollaborationModeId, | ||
| codexArgsOverride: selectedCodexArgsOverride ?? null, |
There was a problem hiding this comment.
Seed codex args from the resolved thread scope
This seed path persists codexArgsOverride from selectedCodexArgsOverride, but that value is synchronized in App.tsx via a passive useEffect, so on thread changes this effect can run with the previous thread's selection before the new scope value is applied. Because the thread is then marked as seeded, the stale override is locked in and future runtime syncs for that thread use unintended args (for example, switching from a thread using --profile a to an unseeded thread can incorrectly persist --profile a there).
Useful? React with 👍 / 👎.
| if (/^[A-Za-z][A-Za-z0-9-]*$/.test(token)) { | ||
| return `${prefix}${token.length === 1 ? "-" : "--"}${token}`; | ||
| } | ||
| return `${prefix}-${token}`; |
There was a problem hiding this comment.
Preserve long-flag equals forms in smart-dash normalization
The smart-dash normalization only treats tokens matching [A-Za-z][A-Za-z0-9-]* as long/short flags; tokens with = fall into the single-dash fallback. As a result, input like —profile=dev is rewritten to -profile=dev (invalid long-flag form), so downstream parsing no longer recognizes it as --profile and the intended runtime override can be dropped or misapplied.
Useful? React with 👍 / 👎.
Summary
Adds per-thread Codex args overrides as a composer control and applies effective args at runtime before thread start/resume/send.
The change keeps per-thread runtime behavior aligned with the selected profile without mutating workspace/global defaults.
The dropdown only renders when more than one args profile option exists (default + at least one configured override), so there is no extra composer noise for users without overrides.
Key Changes
ComposerMetaBar.ThreadCodexParamswithcodexArgsOverride.__no_thread__scope support so pre-thread selections persist.set_workspace_runtime_codex_argsend-to-end:workspaces_core::set_workspace_runtime_codex_args_coresrc-tauri/src/workspaces/commands.rs,src-tauri/src/lib.rs)src-tauri/src/bin/codex_monitor_daemon.rs,rpc/workspace.rs)src-tauri/src/remote_backend/mod.rs)src/services/tauri.ts)startThread/ workspace thread ensureresumeThreadon thread selectionturn/startsend pathsrc/features/threads/utils/codexArgsProfiles.tsto parse/sanitize args and build user-facing labels/options.Behavior Notes
nullstill means “use resolved default args”.{ appliedCodexArgs, respawned }.Test Coverage Added/Updated
src/features/threads/utils/codexArgsProfiles.test.tssrc/features/app/orchestration/useThreadOrchestration.test.tssrc/features/threads/utils/threadCodexParamsSeed.test.tsfor no-thread fallback + sanitization scenariossrc/features/threads/hooks/useThreadMessaging.test.tsxfor runtime-apply behavior and steer skipsrc/features/threads/hooks/useThreads.integration.test.tsxto assert runtime apply occurs before start/resume entry pointssrc/features/threads/hooks/useThreads.integration.test.tsxto assert resume still occurs when runtime preflight failssrc/features/threads/utils/codexArgsProfiles.test.tsfor active-override option inclusion and effective badge behaviorValidation Run
npm run typechecknpm run test -- src/features/threads/hooks/useThreads.integration.test.tsx src/features/threads/hooks/useThreadMessaging.test.tsx src/features/threads/utils/threadCodexParamsSeed.test.ts src/features/threads/hooks/useThreadCodexParams.test.tsx src/features/threads/utils/codexArgsProfiles.test.ts src/features/app/orchestration/useThreadOrchestration.test.tsnpm run testcd src-tauri && cargo checkcd src-tauri && cargo test set_workspace_runtime_codex_args --lib