Share YOLO mode across session families#497
Conversation
Remember YOLO Mode for newly created sessions when the active session has auto-accept enabled, so users do not need to re-enable it for each fresh session. Add an explicit persisted subagent inheritance preference under Appearance > Interaction. The setting defaults off, requires a warning confirmation before enabling, and only lets non-fork child sessions inherit YOLO when their parent session already has YOLO enabled. Keep existing approval safety defaults intact by avoiding hydration-time mutation of historical sessions, and cover the inheritance rules plus confirmation dialog arguments with targeted Node tests. Validation: npm run typecheck --workspace @codenomad/ui; npx tsx --test packages/ui/src/stores/permission-auto-accept.test.ts packages/ui/src/stores/preferences.test.ts; git diff --check; npm run build:linux --workspace @neuralnomads/codenomad-electron-app
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26331023049 Artifacts expire in 7 days.
|
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Request understood: I reviewed the latest PR state as a gatekeeper for regressions and implementation quality. Assumption: the requested outcome is a review-only pass, not code changes. Gatekeeper ResultI would not approve this PR yet. There is one blocking behavioral regression in the new YOLO inheritance path. Findings
Implementation Notes
Validation Run
VerdictBlock until the -- |
Ensure session.updated events carry revert metadata into the session model before evaluating subagent YOLO inheritance. This prevents fork/revert child sessions from bypassing the policy rule that excludes reverted sessions. Add focused adapter coverage for the event path and extend confirmation tests for cancelled enables and disabling without prompts. Also rollback optimistic settings UI state when async setters reject. Validation: npm run typecheck --workspace @codenomad/ui; npx tsx --test packages/ui/src/stores/permission-auto-accept.test.ts packages/ui/src/stores/preferences.test.ts packages/ui/src/stores/session-event-adapters.test.ts; git diff --check
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26337650167 Artifacts expire in 7 days.
|
|
@OfflinePing - I don't see the reason why only the main agent has YOLO mode enabled and not subagents? |
Sorry I dont understand the question really. Right now only the I often tell my Main Session to use Subagents; if it spawns 5-10 of them I dont want to have to give them Yolo-mode or manually approve commands for them. I think they should be able to adopt the Yolo-Mode from the Master Session. Currently this is not implemented. Although I got to work on this Line: I meant, once I enable it for a Session it should stay enabled even across restarts. <- Working on this one Demo of the behaviour: recording_2026-05-23_21.mp4 |
|
@CodeNomadBot |
|
Request understood: I reran the same gatekeeper review against the latest PR state after commit Gatekeeper ResultStill not ready to approve. The previous fork/revert metadata blocker appears fixed, but there is a remaining race in the subagent inheritance flow that can leave a subagent permission stuck waiting even after YOLO is inherited. Findings
Implementation Notes
Validation Run
VerdictBlock until inherited YOLO also drains already-queued permissions for the adopted subagent session. After that, the prior fork/revert blocker looks covered. -- |
Make subagent YOLO inheritance follow the parent session directly and persist auto-accept state with workspace-scoped keys so approvals survive instance recreation. Add server-state persistence, legacy localStorage migration, and queued permission draining for newly inherited child sessions. Remove the separate subagent inheritance preference and confirmation UI because inheritance is now intentionally tied to parent YOLO state. Validation: npm run test --workspace packages/ui; npm run typecheck --workspace packages/ui
YOLO behavior is now simple:
Persistence:
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26344550871 Artifacts expire in 7 days.
|
1 similar comment
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26344550871 Artifacts expire in 7 days.
|
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Request understood: I reviewed the latest PR state as a gatekeeper, with extra scrutiny on regressions, implementation quality, and whether the amount of change is justified. Assumption: this is review-only, not a request to modify the branch. Gatekeeper ResultI would not approve this PR yet. The previous queued-permission drain issue is addressed, but the latest implementation introduces a new behavioral regression in per-session YOLO control and the diff is now much larger than the feature requires. Findings
Resolved From Previous Review
Validation Run
VerdictBlock until inherited state synchronization only clears children that were actually inherited from the parent, and add a regression test for independently enabled child YOLO with a disabled parent. I also strongly recommend reducing the diff: keep persistence and inheritance focused, and avoid global cross-store synchronization unless a smaller explicit-event approach cannot cover the behavior. -- |
|
@OfflinePing As discussed in discord this PR should not contain the YOLO persistance finally. And thinking more about it, we should stick for even simpler form, (I should have done it when I implemented YOLO mode) indeed we can just say Yolo mode is for a session familly = (master + sub sessions) as suggested by Shantur so this become a dead simple implementation ~ 40 lignes : |
|
@CodeNomadBot |
|
Request understood: I reviewed the proposed minimal diff from the comment as a candidate replacement over Short TakeI strongly prefer the proposed direction over the current PR. It matches the simpler product model: YOLO is a session-family property, not a parent setting plus child overrides plus persistence reconciliation. But I would not merge the exact proposed diff as-is. It needs a couple of small fixes/tests around event ordering and incomplete session trees. What Is Good
Findings
Recommended Minimal ShapeI would proceed with this approach, not the large current PR, with these additions only:
VerdictThe proposed diff is the right direction and far better than the current large PR, but it needs the event-ordering drain and incomplete-tree handling before I would approve it. Keep it close to this size; do not reintroduce server-backed YOLO persistence or global synchronization machinery for this feature. -- |
Remove the added localStorage and server-state persistence for YOLO auto-accept so the per-session toggle returns to runtime-only behavior. Keep the subagent adoption feature intact: child sessions can still inherit YOLO while the parent session has it enabled, and inherited children continue to track parent changes within the running app. Also remove new-session YOLO carryover from the active session so only explicit subagent inheritance controls this behavior. Validation: npm run typecheck --workspace @codenomad/ui; npx tsx --test packages/ui/src/stores/permission-auto-accept.test.ts packages/ui/src/stores/session-event-adapters.test.ts; git diff --check
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26393149215 Artifacts expire in 7 days.
|
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Request understood: I reviewed the latest pushed PR state against Gatekeeper ResultStill blocked. The branch is smaller than the previous server-backed persistence version, but it still has serious behavior regressions and it did not adopt the minimal family-root approach discussed in the thread. Findings
Validation Run
VerdictDo not merge this state. At minimum, restore or explicitly justify removal of existing localStorage persistence, fix inherited sync so it does not erase manually enabled child YOLO, and add the missing regression test. My recommended path remains replacing this with the small family-root approach rather than continuing to patch the cross-store inherited-state model. -- |
Replace the inherited-subagent YOLO implementation with a smaller session-family root lookup. This keeps existing per-session persistence semantics while making master and subagent sessions share the same YOLO key, with fork/revert sessions acting as their own family root. The cleanup also removes the earlier settings, adapter, and test-runner plumbing from the effective PR diff so the branch only carries the minimal runtime behavior change.
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Request understood: I reviewed the latest pushed PR state against Gatekeeper ResultThis is much closer to the right shape: the diff is now tiny ( I still would not merge it yet. The exact two safety gaps from the proposed-diff review remain unfixed, and the PR metadata/validation is stale. Findings
What Improved
VerdictClose, but still block until the event-ordering drain and incomplete-parent-chain handling are fixed. After that, update the PR body to match the actual implementation and add focused tests for root resolution and permission-before-session-metadata ordering. -- |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26395260493 Artifacts expire in 7 days.
|
Keep incomplete session-family chains rooted at the last loaded session so child toggles do not write to a missing parent key. Add focused resolver coverage for missing parents, loaded chains, and fork roots. Re-drain queued child permissions after fetched or updated session metadata establishes a parent relationship, covering permissions that arrived before the child session was hydrated.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26396470458 Artifacts expire in 7 days. |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26396481956 Artifacts expire in 7 days.
|
|
@CodeNomadBot |
|
Request understood: I reviewed the latest pushed PR state after Gatekeeper ResultNo blocking findings in the latest diff. The two prior blockers are addressed in the current
The implementation is also back to the right size and shape: Notes
Validation
VerdictApprove from the gatekeeper perspective. CI with installed dependencies still needs to be the source of truth for typecheck/test execution. -- |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26409332817 Artifacts expire in 7 days.
|
There was a problem hiding this comment.
Current code drains only the updated session, this can miss nested/out-of-order cases where a queued grandchild permission becomes eligible only after its parent metadata loads.
Suggested code change:
- Replace/export a broader helper in
instances.ts:
function drainAutoAcceptPermissionsForInstance(instanceId: string): void {
drainAutoAcceptPermissions(
instanceId,
getPermissionQueue(instanceId),
sendPermissionResponse,
hasPendingPermission,
)
}- In
session-events.ts, after session metadata fetch/update establishesparentId, call:
drainAutoAcceptPermissionsForInstance(instanceId)instead of:
drainAutoAcceptPermissionsForSession(instanceId, sessionId)This should cover direct children, nested subagents, and out-of-order metadata hydration.
Replace the session-specific auto-accept drain with an instance-wide queue drain when session metadata establishes a parent relationship. This covers nested and out-of-order subagent hydration where a queued grandchild permission only becomes eligible after an intermediate parent is loaded.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26417296971 Artifacts expire in 7 days.
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26417505776 Artifacts expire in 7 days.
|
|
Thanks ! |

Summary
Solves #495
Validation
Build Artifact