Add cave-code command and skill support#19
Conversation
romgenie
left a comment
There was a problem hiding this comment.
PR #18 carryover is addressed:
pendingTranscriptStartLineIndexRefandpendingApprovalSuppressClientToolsRefeach now have their own one-liner comment (src/cli/App.tsx:1197-1202), with the transcript ref described as "set at user-turn start and kept through approval reentry" and the suppression ref scoped to the requires_approval → approval-result window.handleCancelApprovalsexplicitly resets both the ref and the queue metadata tosuppressClientTools: false, andapproval-recovery-wiring.test.tspins that behavior with a new assertion.- The SKILL.md alignment test now requires both opening and closing quotes (
"${example}"), the server-tool denylist is gone from the mode-switch prompt (test assertsserver-side tools such asis absent), the non-interactive/cavemanbranch returnssuccess: falsewith an explicit "must be used inside the interactive CLI" message, andsuppressPreparedClientToolscarries a comment explaining why the context snapshot is preserved. - Windows
chmodSyncinbuild.js, deadareToolSetsEqualdropped fromreconcileExistingAgentState.ts,ConversationListItemreplacesanyingenerate-memory-viewer.ts, and thepersona_caveman.mdxrow is inprompts/README.md. - The
personality.tsrefactor from ternary chains toPERSONA_TEMPLATE_BY_ID/HUMAN_TEMPLATE_BY_IDlookups with aPERSONA_CONTENT_OVERRIDESmap for codex/claude is a nice cleanup and keeps the caveman wiring symmetrical with the other presets.
One small observation, not blocking:
| @@ -11815,6 +11918,8 @@ ${SYSTEM_REMINDER_CLOSE} | |||
| } | |||
There was a problem hiding this comment.
The queued-approval path now preserves suppressClientTools across an interrupt + new-user-message resubmission by reading from queuedApprovalMetadataRef. That's correct as a preservation of state, but it does mean: if a /caveman turn ever reached requires_approval and the user interrupted with a fresh regular message, that fresh message's turn would inherit the suppression flag and be sent with clientTools: [].
In practice this can't happen — /caveman submits with empty clientTools, so the agent has no client-side tools to request approval for, and server-side tools don't route through this approval path. So this is preserving correctness for a case that shouldn't arise rather than a live bug.
If you ever widen suppressClientTools to a mode that can legitimately trigger approvals, this branch will silently extend the suppression into the interrupting message. Worth a short comment near suppressClientToolsForSubmission = queuedSuppressClientTools; that the flag intentionally rides along with the queued continuation — or, if you prefer, gating the carry-over on initialInput.length === 1 (queued-only, no user message appended) so a new user message always starts fresh. Either one is fine; happy to leave as-is.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f54f3cd7ce
ℹ️ 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".
| allowReentry: true, | ||
| suppressClientTools: pendingApprovalSuppressClientToolsRef.current, | ||
| }); |
There was a problem hiding this comment.
Preserve tool suppression when resuming restored approvals
This continuation path reads pendingApprovalSuppressClientToolsRef.current, but restored approval flows (recoverRestoredPendingApprovals) never initialize that ref from the restored batch before users continue approvals. In a resumed conversation where pending approvals originated from a /caveman mode-switch turn, this call can send suppressClientTools: false and re-advertise client tools, letting the model invoke tools during a continuation that should remain tool-suppressed. Please carry suppression metadata through restored approval recovery (or pass it explicitly) before this reentry call.
Useful? React with 👍 / 👎.
Summary
mainwith upstream Letta through31469dfccavemaninternal personality preset/cavemanslash command that ships with installed Letta Code/cavemanas a conversation-local mode switch and send its mode-switch request without advertised client tools/cavemanno-tools behavior through direct reentry, manual approval-result continuations, and queued approval continuations after interruptslite,full,ultra,wenyan-lite,wenyan-full, andwenyan-ultraas public modes, withwenyankept as an alias forwenyan-fullcave-codeas the public nickname alias for thecavemaninternal personality presetpersona_caveman.mdx, remove redundant human-content overrides, make the non-interactive/cavemanresult explicit, remove the brittle server-tool denylist from the mode-switch prompt, document advertised-tool suppression and pending-approval lifecycle, fix Windowsbun run build, clear existing lint warnings, split ref lifecycle comments, and reset cancelled approval queues back to normal client-tool advertisingValidation
bun test src\tests\agent\personality.test.ts src\tests\cli\caveman-command.test.ts src\tests\channels\runtimeDeps.test.ts src\tests\cli\approval-recovery-wiring.test.tsbun run typecheckbun run lintbun run buildReplaces #18.
Replaces #17.
Replaces #16.
Replaces #15.
Replaces #14.
Replaces #13.
Closes #1