Skip to content

fix(dcode): reset approval mode after clearing a thread - #13347

Closed
jyaunches wants to merge 1 commit into
mainfrom
codex/issue-12747-clear-approval
Closed

jyaunches wants to merge 1 commit into
mainfrom
codex/issue-12747-clear-approval

Conversation

@jyaunches

Copy link
Copy Markdown
Contributor

Outcome

Managed DCode returns to Manual when /clear or /force-clear creates a new thread. Previously, the new thread retained Auto or YOLO from the previous conversation.

Reason

The approval menu offers Auto for the current thread, but the native reset preserves the approval mode. This change restores fresh consent at the clear-command boundary requested in #12747, narrowing the lifecycle persistence introduced by #11683.

Related issues

Fixes #12747.

Changes

  • Reset approval through the native setter when a clear command changes the thread ID. This updates the app, session, status bar, and live approval store; native persistence failure handling blocks new runs.
  • Reset in finally so a failure after thread creation cannot retain consent. A failure before thread creation preserves the existing mode.
  • Cover both clear commands, all native modes, repeated opt-in, and failures before and after reset. Preserve resume and agent-restart behavior.

Verification

  • Focused Vitest regression against unmodified main — failed because Auto survived clear; passed with the fix.
  • npx vitest run --project integration test/agents/deepagents/langchain-deepagents-code-approval-lifecycle.test.ts test/agents/deepagents/langchain-deepagents-code-direct-module-patch.test.ts test/agents/deepagents/langchain-deepagents-code-managed-entrypoints.test.ts — 178 passed, two existing skips.
  • NODE_OPTIONS=--max-old-space-size=8192 npm run typecheck:cli — passed. Initial contributor setup exhausted the default Node heap during this check.
  • sparky / spark-5ba8, Ubuntu 24.04.4 ARM64 — reproduced with installed DCode 0.1.55 and with DCode 0.1.71 patched from base 486ff49e9fe58cedd959c1454cb25c875291480c. Issue findings.
  • Candidate DCode 0.1.71 on sparky — 12 runtime checks passed, including Manual/Auto/YOLO, both clear commands, normalized input, early/late failures, and blocked execution after an approval-store write failure. Successful resets updated the status bar and wrote Manual for the new thread. Fresh explicit Auto opt-in remained available.
  • Runtime checks used Textual test mode in isolated Docker containers with networking disabled. Server startup was suppressed; the persistence check used a recording store client. This is not live-inference or OpenShell-onboarding evidence. Containers were removed.
  • ARM64 base image: ghcr.io/nvidia/nemoclaw/langchain-deepagents-code-sandbox-base@sha256:0f9502a2babfbf1183f614e488d78345ab6aa92b9138bf574f89c1b1239d56e4. The candidate patch applied twice without error and the installed app compiled.
  • Normal pre-commit and pre-push hooks — passed, including publication validation and all three compiler lanes.
  • Diff inspected: no secrets, API keys, credentials, or unrelated changes.

Review notes

Self-review covers the three-file change at 1508f729c6813580b1ddd877fb6e34dce5d23e11 in NVIDIA/NemoClaw, including the sensitive runtime path agents/langchain-deepagents-code/patch-managed-deepagents-code.py. The review checked reset detection, failure propagation, native persistence handling, and preservation of adjacent lifecycle behavior. Independent review is pending; this PR is a draft.

Public documentation updates may follow through the repository's post-merge documentation workflow.


Signed-off-by: Julie Yaunches jyaunches@nvidia.com

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
@jyaunches jyaunches self-assigned this Oct 16, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage/plugin

main 63002cd codex/issue-12747-cl... 1508f72 +/-
96% 97% +1%
View coverage of the 10 most impacted files.
File main 63002cd codex/issue-12747-cl... 1508f72 +/-
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/index.ts 94% 93% -1%
nemoclaw/src/bl...print/runner.ts 95% 95% 0%
nemoclaw/src/bl...ime-identity.ts 97% 97% 0%
nemoclaw/src/bl...t-management.ts 100% 100% 0%
nemoclaw/src/co.../config-show.ts 100% 100% 0%
nemoclaw/src/commands/slash.ts 100% 100% 0%
nemoclaw/src/ru...time-context.ts 100% 100% 0%
nemoclaw/src/sh...er-boundary.cts 100% 100% 0%
nemoclaw/src/on...native-route.ts 0% 100% +100%

TypeScript / code-coverage/cli

main 63002cd codex/issue-12747-cl... 1508f72 +/-
84% 86% +2%
View coverage of the 10 most impacted files.
File main 63002cd codex/issue-12747-cl... 1508f72 +/-
src/lib/onboard.ts 62% 50% -12%
src/lib/state/l...diness-lease.ts 66% 83% +17%
src/lib/inferen...ollama/proxy.ts 41% 61% +20%
src/lib/onboard.../application.ts 55% 84% +29%
src/lib/inferen...er/lifecycle.ts 0% 65% +65%
src/lib/domain/...y/dimensions.ts 0% 71% +71%
src/lib/actions...ry/operation.ts 0% 76% +76%
src/lib/actions...try/snapshot.ts 0% 78% +78%
src/lib/inferen...ovider/index.ts 0% 88% +88%
src/lib/onboard...ternal-image.ts 0% 91% +91%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 16, 2026 14:00 UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit 1508f72. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

Request review only when Require no Advisor blockers is green.

All previous runs

@jyaunches

Copy link
Copy Markdown
Contributor Author

Closing as this was reviewed and decided to be fixing an upstream and perhaps intentional prodcut decision in dcode.

@jyaunches jyaunches closed this Oct 21, 2026
@wscurran wscurran added area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening integration: dcode LangChain Deep Code integration behavior labels Oct 26, 2026
@cv
cv deleted the codex/issue-12747-clear-approval branch November 21, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening integration: dcode LangChain Deep Code integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Ubuntu 22.04][Agent&Skills] DCode clear starts a new thread but keeps auto-approval enabled

2 participants