Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 619760fe92
ℹ️ 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".
|
Addressed the two Codex findings in
Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff8ada9f58
ℹ️ 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".
|
Addressed the latest Codex review items in 9ffb2f2991:
Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ffb2f2991
ℹ️ 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".
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@clawsweeper please review this PR after the latest Codex follow-ups. I updated the PR body per CONTRIBUTING with What Problem This Solves / Why / User Impact / Evidence, resolved the addressed Codex threads, and pushed Evidence is in the PR body; latest local checks:
|
|
Codex review: needs real behavior proof before merge. Reviewed September 15, 2026, 4:54 AM ET / 08:54 UTC (Revision 33). ClawSweeper reviewWhat this changesAdds explicit names to new-session chat commands and close/delete commands, with Gateway cleanup handling and Control UI integration. Merge readiness⛔ Blocked before merge - 23 items remain This remains useful, distinct work absent from current main. The latest commit resolves late rename-error publication, but session lifecycle defects, incomplete generation guards, and insufficient current behavior proof still block merge. Priority: P2 Review scores
Verification
How this fits togetherChat commands arrive through channel adapters or the Control UI. Gateway session operations coordinate active replies, stored conversations, and transcript cleanup before returning confirmations and updated session lists. flowchart TD
A[Channel chat command] --> C[Command parsing and authorization]
B[Control UI command] --> C
C --> D[Gateway session lifecycle]
D --> E[Active replies and admissions]
E --> F[Session and transcript storage]
F --> G[Confirmation and session list]
Decision needed
Why: The proposed native behavior changes the established model/prompt contract, while the actual registry still supplies generic raw arguments. Before merge
Findings
Agent review detailsSecurityNeeds attention: The handoff needs originating-authority proof, and shared replies expose local worktree details; no supply-chain change was found. PR surfaceSource +1059, Tests +2577, Docs +4. Total +3640 across 35 files. View PR surface stats
Review metrics
Mantis proof suggestionControl UI chat proof would help verify visible naming, selected-session identity, and incomplete reset outcomes. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Require explicit naming, validate before reset, and keep naming and deletion with the serving Gateway's lifecycle owner using live initiator authority and authoritative generation-bound results. Do we have a high-confidence way to reproduce the issue? Yes for the remaining patch defects: source traces establish self-cancellation, validation after reset, and missing generation checks. These paths were inspected without executing target code. Is this the best way to solve the issue? No. Reusing Gateway lifecycle operations is appropriate, but the current composition does not preserve initiator, generation, and outcome ownership; explicit naming would also avoid a competing model classifier. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4a54a573d56a. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (32 earlier review cycles; latest 8 shown)
|
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIF evidence with Convex-leased Telegram credentials.
Motion-trimmed clips: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ad0eafa91
ℹ️ 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".
| return "consumed-error"; | ||
| } | ||
| } | ||
| return resetResult === "failed" ? "cancelled" : "completed"; |
There was a problem hiding this comment.
Preserve uncertainty from board-backed named resets
When a board-backed Control UI session runs a named /new and clearChatHistory() returns "uncertain" after a disconnect or timeout, the label patch is correctly skipped, but this line converts the outcome to "completed". The submit and outbox paths then remove the command and release its recovery payload as if the reset and rename were confirmed, even though the session may have reset without the requested name—or may not have reset at all. Propagate the uncertain outcome and reconcile it rather than reporting completion.
AGENTS.md reference: ui/AGENTS.md:L15-L19
Useful? React with 👍 / 👎.
| "close", | ||
| "Close the current session (archives unless incognito; not for main).", | ||
| "session", | ||
| "standard", | ||
| ), |
There was a problem hiding this comment.
Allow close commands without model access
When the Control UI has modelRequiredReason set because no model is configured or model setup is failing, these new commands lack a modelIndependent policy, so isModelIndependentChatCommand() returns false and both the slash menu and direct send path disable /close and /delete. Closing a session does not require model execution, so register both commands as model-independent (at least for their no-argument form) to keep cleanup available in this state.
Useful? React with 👍 / 👎.
| "close", | ||
| "Close the current session (archives unless incognito; not for main).", | ||
| "session", | ||
| "standard", | ||
| ), |
There was a problem hiding this comment.
Let close commands run beside active session work
When /close or /delete arrives while another run owns the session, these definitions are not marked activeRunSafe, so dispatch waits on the existing run's admission instead of resolving the command concurrently. The command therefore cannot reach sessions.delete and its explicit active-run cancellation until the competing run finishes; a long-running or stuck turn can prevent the user from closing the session at all. Mark both close aliases as active-run-safe so their lifecycle drain can perform the cancellation they were designed to own.
Useful? React with 👍 / 👎.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 483b85c054
ℹ️ 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".
| labelPatched = await sessions.patch( | ||
| previousSessionKey, | ||
| { label: options.label }, | ||
| labelAgentId ? { agentId: labelAgentId } : undefined, | ||
| ); |
There was a problem hiding this comment.
Bind the board rename to the reset incarnation
When another client resets this board-backed session after clearChatHistory() returns but before this patch completes, the session key and local view remain current while its session ID has changed. Because the label patch supplies no expectedSessionId, it renames the newer conversation and reports the original named /new as successful. Carry the reset result's incarnation into this request—or make reset-and-label atomic—so a late patch is rejected instead of modifying a successor session.
AGENTS.md reference: ui/AGENTS.md:L11-L14
Useful? React with 👍 / 👎.
Extracts reusable writeSessionLabel from /name, adds /close and /delete (alias) session commands routed via gateway sessions.delete, and supports naming a fresh session with /new --name / name: / native title args. Chat-initiated /close hands its retained session-work admission to the server via a single-use admission handoff (admissionHandoffId), so the nested cross-context sessions.delete RPC adopts the initiating lease instead of deadlocking on it; the abort path exempts the initiating chat run through exemptChatRunId/exemptRunId. Model-directive detection stays scoped to the active agent and uses the synchronous alias/config heuristic so /new stays off the plugin cold-load path. Squashed reapplication of the PR branch on current main (rounds 1-7 of Codex review feedback included). Co-authored-by: Copilot <[email protected]>
Address Codex review round 8: - Replace the prefix-based model-ref heuristic in isModelRefTail with a classification mirror of the reset-model resolver: same allowed-key set (buildAllowedModelSetWithFallbacks), same explicit/provider-scoped/fuzzy attempts, and cold plugin catalog escalation only for slash-form tails. Fallback refs no longer swallow session names; unknown brand words (e.g. "Gemini planning") name the session instead of being dropped. Exact alias hits stay directives even when policy hides the target so the resolver keeps ownership of policy errors. - Reject native structured titles that are explicit model flags (--model / model:) so they reach the reset-model resolver instead of freezing the flag text as a label. - Bind the /new label write to the targeted session incarnation: writeSessionLabel now takes expectedSessionId and refuses to relabel when a concurrent reset rotated the session while hooks ran. - Run the unauthorized/admin gates for /close before the tail-shape check, retry the admission handoff with the raw RPC session key when the normalized key does not match, and drop the unused expectedSessionUpdatedAt plumbing. - Add regression tests for all of the above. Co-authored-by: Copilot <[email protected]>
…al failures Address Codex round-9 findings on the named /new flow: - Surface the post-reset session identity (sessionId + lifecycleRevision) from sessions.reset through the UI session store, and send it as expectedSessionId/expectedLifecycleRevision CAS guards on the follow-up label patch so a stale incarnation can never be renamed. - Stop reporting a landed-but-partially-failed /new as retryable: createSession now returns completed/cancelled/consumed-error, and a failed or rejected label patch after a committed reset maps to "uncertain" dispatch (error surfaced on the pane, draft not restored) instead of "cancelled". - Normalize manifest aliases when matching cold plugin catalog entries in /new model classification (e.g. google/gemini-3-pro now matches its gemini-3.1-pro-preview catalog entry without cold-loading plugins). Co-authored-by: Copilot <[email protected]>
… /close timeouts honestly Codex round-10 findings on the named-session chat commands PR: - /new <bare-plugin-model-id> before the first catalog publish fell through to session naming because classification only consulted the warm prepared catalog. Classification now substitutes the synchronous manifest model catalog (loadManifestModelCatalog with fallbackToMetadataScan: false) as the classification catalog while cold, so manifest-declared plugin models run the identical allowed-set machinery cold and warm. Runtime-augmented models still escalate through the existing slash-gated cold resolver. - /close raced its 20s client budget against the gateway's post-mutation worktree cleanup: the server commits the deletion before that cleanup and only responds afterwards, so a timeout surfaced as an error for a close that had already committed. The budget now covers drain + a 45s cleanup allowance, and an expired budget yields an honest uncertainty reply while leaving the local store entry untouched. - docs: the /close row now states that incognito sessions are deleted without an archive and that the main session is refused with /reset as the pointer. Adds regression tests for the cold manifest classification (directive without a catalog load, non-model title still names the session) and for the /close timeout path (uncertainty reply, preserved local entry, non-timeout errors rethrown). Co-authored-by: Copilot <[email protected]>
… session A chat-initiated `/close` holds two session-work admissions (the gateway chat.send admission plus its nested reply-turn admission), but the admission handoff only carried the first covering admission. The server adopted that one and then blocked draining the other -- which the initiating turn itself held -- so every chat `/close` on an active session timed out UNAVAILABLE after 15s without deleting anything. - Make admission handoffs composite: `createSessionWorkAdmissionHandoffForCurrent` now hands off every covering admission in the current async context, and `consumeSessionWorkAdmissionHandoff` adopts them all under one lease (the wire protocol is unchanged). A released member admission invalidates the token so consumers fall back to the drain path. - Even with the deadlock fixed, the confirmation reply was silently dropped: `ensureSessionRuntimeCleanup` aborted the initiating reply run via `abortEmbeddedAgentRun` -> `abortReplyRunBySessionId`, so the dispatch pipeline saw an aborted reply operation and never delivered the reply. Thread `preserveActiveReplyRun` through `cleanupSessionBeforeMutation` and skip both the reply-run abort and the run-end wait for the initiating turn when the delete adopted an admission handoff. Competing runs are still aborted by chat.abort and drained by `interruptSessionWorkAdmissions`. Regression coverage: composite-handoff adoption and member-release invalidation in session-lifecycle-admission.test.ts; preserve-reply-run abort/wait semantics in runs.test.ts. Co-authored-by: Copilot <[email protected]>
…ly model ids Two /new classification gaps from review: - Bare model ids from runtime/refreshable-discovery catalogs (e.g. LM Studio) were frozen as session names while the prepared catalog was still cold: the on-demand escalation was gated to provider/model-shaped tokens and the manifest fallback cannot represent runtime-only entries. Bare tokens now escalate under the resolver fuzzy precondition when an installed plugin declares runtime/refreshable discovery (new manifestModelCatalogDeclaresRuntimeDiscovery helper), matching loaded entries by exact id so ordinary titles cannot be swallowed. Installs without such plugins never pay a catalog load for plain session names. - Explicit name prefixes with empty values (/new --name=, /new --name, /new name:) fell through the explicit-name parse; native surfaces persisted the raw directive as the session label. The parser now returns a missing-name marker and /new replies with a validation error before the reset hooks run, so no reset happens and nothing is labeled. Co-authored-by: Copilot <[email protected]>
…and qualify native close/delete descriptions Codex round 2 on the chat-command lifecycle work: - The delete-session timeout reply now carries the same transcript-mirror block as the success replies: sessions.delete commits the deletion before slow worktree cleanup, so on an RPC timeout the session is likely gone and persisting the uncertainty reply would resurrect an orphan transcript row via createIfMissing. transcriptOwner is captured before the RPC so the timeout branch can reuse it (deleteSessionSuccessReply renamed to deleteSessionOutcomeReply to cover both outcomes). - Native /close and /delete registry descriptions no longer promise unconditional archiving; archiving is skipped for incognito sessions and the commands are rejected for main. Co-authored-by: Copilot <[email protected]>
…solution - Preserve /close initiator via exemptRunId -> excludeRunIds wiring in chat.abort handler - Register native close/delete command metadata with qualified lifecycle descriptions - Align UI /new flow with ChatNewSessionResult and keep consumed-error semantics - Restore board-preserving /new label patch behavior after reset Co-authored-by: Copilot <[email protected]>
Post-rebase validation surfaced several places where main's independent evolution since this PR's last review round required adaptation: - session-lifecycle-admission: assign the `lease` back-reference on `SessionWorkAdmission` (it was declared but never set), which is what `createSessionWorkAdmissionHandoffForCurrent` needs to build a handoff for the initiator's own retained admission. - session-work-admission-handoff: add the now-required `isActive` member to the composed lease returned by `composeSessionWorkAdmissionLeases`, reporting active only while every underlying lease in the handoff bundle is still active. - commands-reset: adapt to main's model-selection-shared refactor (`buildAllowedModelSetWithFallbacks` -> `createModelVisibilityPolicyWithFallbacks`, `resolveModelRefFromDirectiveString` -> `resolveModelRefFromString`). Also tighten `isModelRefTail`'s alias/fuzzy-match attempts to only trust a resolved selection when it is an alias hit or its key is in the allowlisted catalog, since main's newer unrestricted-policy behavior in `resolveModelDirectiveSelection` now returns a synthetic off-catalog selection for any bare word, which was otherwise misclassifying plain-text `/new` session names as model directives. - commands-name: replace the manual `entries` uniqueness scan in `writeSessionLabel` with the `isLabelInUse` callback that `applySessionPatchProjection`'s context now provides instead of a raw entry list. - commands-reset-hooks.test / commands-delete-session.test: update renamed identifiers (`upsertSessionEntry` -> `replaceSessionEntry`, `setCurrentPluginMetadataSnapshot` -> `setGatewayPluginMetadataSnapshot`), and replace hand-rolled `PluginMetadataSnapshot` literals with `createPluginMetadataSnapshotFixture` now that the snapshot shape carries additional required fields. Also pin an empty plugin snapshot in the "does not cold-load the catalog for a plain multi-word session name" test so it does not pick up this repo's real bundled lmstudio/ollama plugins (which do declare refreshable discovery) as a side effect of the bare-token runtime-discovery check. Co-authored-by: Copilot <[email protected]>
…Session The pageState.createChatSession wrapper set up in ChatPaneLifecycle dropped its `options` parameter when delegating to `this.createSession`, so named `/new --name <title>` requests from the Control UI chat pane silently lost the requested label end-to-end. Add a regression test that asserts createChatSession forwards its options argument to createSession unchanged. Co-authored-by: Copilot <[email protected]>
The rebase of PR openclaw#95700 onto current origin/main surfaced a real type error: `isResetAuthorized`, `parseNamedNewSessionTail`, `isModelRefTail`, and `getNativeCommandTitleTail` were typed to take the full `HandleCommandsParams`, but `maybeHandleResetCommand` only has `ResetCommandParams` available (`resolvedThinkLevel`/`resolvedReasoningLevel` are resolved later in `handleCommands`, after reset handling runs). None of these functions actually read the omitted fields, so narrow their parameter type to `ResetCommandParams` instead. `writeSessionLabel` (and its internal `syncNameSessionEntry` helper) in `commands-name.ts` has the same property and is narrowed the same way, with `ResetCommandParams` now exported from `commands-reset.ts` for reuse. Co-authored-by: Copilot <[email protected]>
…nto sessions.delete Two review findings on PR openclaw#95700 pointed at parameters the client already sends but the server silently dropped: - `admissionHandoffId`: a chat-initiated /close hands its own retained session-work admission to this RPC because deleting through the nested gateway call leaves the admission's async context, so without adopting the handoff the server would treat the initiator's own admission as competing work and block until it drains, which can never happen until this very RPC returns. `sessions-delete.ts` now consumes the handoff via `consumeSessionWorkAdmissionHandoff` and runs the whole deletion under the adopted lease, so `isCompetingSessionWorkAdmissionActive` and the interruption path both see it as the initiating turn instead of a competitor. Falls back to today's drain-and-retry behavior whenever the token is absent, stale, or scoped to a different identity. - `exemptChatRunId`: the lifecycle drain aborts competing chat runs on the session before deleting it; without exempting the initiating run, that abort would terminate the /close turn itself and surface an aborted state instead of the deletion success reply. `exemptChatRunId` now flows into the drain's own `abortChatRunsForSessionKeyWithPartials` call via `excludeRunIds`, and into `hasGatewaySessionAbortOwner` (used by the authoritative-work recheck) so the exempted run is not later reported as still active either. Added regression tests covering both: adopting a handed-off admission completes without interrupting it, and an exempted chat run survives the delete's session-wide abort. Co-authored-by: Copilot <[email protected]>
…rship
Codex flagged that chat.abort trusted the client-supplied exemptRunId
without checking whether the requester actually owns that run, letting a
non-admin caller shield any run (including ownerless ones normally in
scope for a session-wide abort) from being aborted just by naming it.
Gate the exemption on canRequesterAbortChatRun(..., { requireOwnerMatch:
true }) unless the requester is admin, falling back to aborting the run
normally when ownership does not match or no entry is found. Add a
regression test proving a non-admin caller cannot protect an ownerless
run they do not own via exemptRunId, alongside the existing self-exemption
test that must keep working unchanged.
Co-authored-by: Copilot <[email protected]>
…gent
Codex flagged that the /close and /delete main-session guard called
resolveMainSessionKey(cfg), which resolves an ambient owner and throws
AgentSelectionRequiredError for explicit multi-agent fleets with no single
default agent. That crashed the guard (and therefore the whole command)
for any non-main session in that configuration, not just main-session
deletions.
Use resolveAgentMainSessionKey({ cfg, agentId: params.agentId }) instead,
which resolves the active agent's own main key without requiring an
unambiguous ambient owner. The "global" scope and other-agent main-key
checks alongside it are unaffected. Add regression tests covering both a
successful non-main deletion and a still-blocked own-main deletion under
explicit multi-agent ownership.
Co-authored-by: Copilot <[email protected]>
…check
Codex flagged that once a command-only /close preserves its own initiating
reply run during cleanup (preserveActiveReplyRun), the final success check
in ensureSessionRuntimeCleanup still called isEmbeddedAgentRunActive(sessionId)
without that option, so it kept counting the preserved reply run as active
work. Every command-only /close therefore returned UNAVAILABLE ("session is
still active") even after every genuine embedded run had drained.
Add a matching preserveReplyRun option to isEmbeddedAgentRunActive (mirroring
the existing option on waitForEmbeddedAgentRunEnd) and thread it into that
final check via the existing preserveActiveReplyRun parameter. Add a
regression test proving the preserved reply run is excluded only when the
option is requested, while ordinary callers still see it as active.
Co-authored-by: Copilot <[email protected]>
…as a prompt Codex flagged that the /new documentation promises text-command surfaces preserve a non-model free-text tail as the prompt, but Control UI intercepts typed /new, parses only an explicit --name/name: label from the tail, and never dispatches it as a message -- silently dropping the promised prompt for Control UI users. Qualify both the Control UI note and the Argument notes entry to state this Control UI exception explicitly. Co-authored-by: Copilot <[email protected]>
The /new model classifier was building its prepared-model catalog request without the active agent's agentDir/workspaceDir, so a model published only under that agent's workspace was treated as a plain session title instead of falling through to the reset-model resolver. Mirror the canonical applyResetModelOverride catalog scope for classification so the same model remains visible and is resolved consistently. Add a regression test covering a prepared-catalog model that exists only under that agent-scoped workspace. Co-authored-by: Copilot <[email protected]>
Allow /close and /delete to remain available without a model and while an active run is present, matching the command semantics already enforced by the session lifecycle handlers. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ae3d0737e
ℹ️ 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".
| stopReason: params.action, | ||
| requester: { isAdmin: true }, | ||
| includeProtectedRuns: true, | ||
| excludeRunIds: params.exemptChatRunId ? new Set([params.exemptChatRunId]) : undefined, |
There was a problem hiding this comment.
Exempt the initiating reply operation from the drain
When /close has no older active run, command resolution registers the command itself in replyRunRegistry; this new exclusion only protects the Gateway chat controller, while the callback below still calls replyRunRegistry.abort(key)/abortReplyRunBySessionId, and replyWork then waits for that same operation to finish. The operation cannot finish until this nested sessions.delete returns, so the drain times out and the close confirmation is lost. Fresh evidence beyond the earlier self-abort comments is that the now-wired excludeRunIds is still not honored by the reply-registry aborts or waits. Carry the initiating reply-operation identity through this entire drain.
AGENTS.md reference: AGENTS.md:L96-L96
Useful? React with 👍 / 👎.
| // Only patch on a confirmed-completed reset: an "uncertain" reset may not | ||
| // have landed a fresh incarnation, so patching the label could rename the | ||
| // wrong session. | ||
| if (options?.label && isCurrent() && resetResult === "completed") { |
There was a problem hiding this comment.
Preserve named-reset failure when the pane becomes stale
If the connection, agent, or pane context changes while clearChatHistory() is pending and the reset returns "completed", isCurrent() is false, so this condition silently skips the requested label patch; line 310 nevertheless returns "completed", causing the /new --name ... command to be retired as successful even though the new session is unnamed. Distinct from the already reported late patch-error case, this happens before the patch starts and produces no error at all; return a consumed/uncertain result or reconcile the label against the originating owner.
AGENTS.md reference: ui/AGENTS.md:L11-L14
Useful? React with 👍 / 👎.
| if (deletion.worktreePreserved) { | ||
| const { branch, path } = deletion.worktreePreserved; | ||
| return deleteSessionOutcomeReply( | ||
| `✅ Session ${closedVerb}.\n⚠️ Its worktree could not be removed and may hold uncommitted or unpushed work: branch “${branch}” at ${path}. Remove it manually when you no longer need it.`, |
There was a problem hiding this comment.
Redact preserved-worktree paths from channel replies
When cleanup preserves a dirty or unpushed worktree, this reply sends its raw branch and filesystem path back to the originating chat. Channel callers only need to be command-authorized—not owner/admin—so in a shared Discord, Slack, or Telegram conversation the path can disclose operator usernames, repository layout, or private project names to other allowed command users. Return a generic cleanup warning on channel surfaces, or expose these details only through an owner/admin-local surface.
AGENTS.md reference: AGENTS.md:L90-L90
Useful? React with 👍 / 👎.
| handoff.entries.some((entry) => | ||
| identities.some((identity) => !entry.admission.identities.has(identity)), | ||
| ) |
There was a problem hiding this comment.
Preserve the legacy handoff shape across hot reloads
When an update or duplicated runtime chunk loads this module while the process-global handoff map still contains a token created by the previous implementation, that entry has the legacy { admission, lease } shape rather than entries. This new unconditional handoff.entries.some(...) then throws when the token is consumed; the reverse old-consumer/new-producer pairing is also incompatible, so an in-flight lifecycle handoff can fail and strand its session admission during a live update. Normalize both shapes or version and migrate the process-global singleton before using the new representation.
AGENTS.md reference: AGENTS.md:L69-L69
Useful? React with 👍 / 👎.
Keep the board-backed reset rename anchored to the post-reset session incarnation instead of patching whatever session currently owns the key. This avoids renaming a newer session after an uncertain reset. Co-authored-by: Copilot <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |




What Problem This Solves
Users can name sessions with
/name, but starting a new named session from chat required an extra step. Chat users also had no direct command to close/archive the current non-main session, leaving session cleanup dependent on UI surfaces or backend tools.Why This Change Was Made
This PR extends session-management slash commands so
/newcan create a freshly reset, named session with explicit name syntax while preserving the existing/new <model>and post-reset prompt fallthrough behavior. It also adds/closeand/deletefor archiving the current non-main session through the gateway session lifecycle.User Impact
/new Beispielsessionname,/new --name Beispielsessionname,/new name:Beispielsessionname, and quoted/new "Planning notes"can start a fresh named session./new gpt-5.5,/new opus, and native provider/model values keep falling through to model selection./closeand/deletearchive the active non-main session from chat, but refuse main sessions and requireoperator.adminfor internal gateway clients.Related
/new <name>;/namealready exists from feat(commands): add /name to rename the current session from chat #88581)titlereplaces/augmentslabelEvidence
pnpm exec oxfmt --check src/auto-reply/reply/commands-delete-session.ts src/auto-reply/reply/commands-delete-session.test.ts src/auto-reply/reply/commands-reset.ts src/auto-reply/reply/commands-reset-hooks.test.tspnpm exec vitest run src/auto-reply/reply/commands-delete-session.test.ts src/auto-reply/reply/commands-reset-hooks.test.ts src/auto-reply/reply/commands-name.test.ts— 37 tests passedpnpm tsgo:core:testAI Assistance
AI-assisted with GitHub Copilot CLI. I reviewed the generated changes, resolved addressed Codex review conversations, and validated the touched command surfaces locally.
ClawSweeper chat proof (exact head
066cae5c25)Isolated gateway built from this PR head (
dist/build-info.jsoncommit matchesgit rev-parse HEAD), fresh state dir, dummy model provider (no secrets), persistent admin-scopedGatewayClientover ws. Transcript below shows the visible chat replies plus the resultingsessions.liststate for every command.Notes:
/new gpt-5.6-lunafalls through to a model directive (the[run error]is the dummy provider rejecting inference, which is expected here) — the session label is not hijacked./closeonagent:main:web:proof-closereturns its visible confirmation and the session is gone fromsessions.list. This works because this head also fixes the admission-handoff deadlock and preserves the initiating reply run during cleanup (see latest commit).