Skip to content

feat(agents): session self-service tools - #107471

Merged
steipete merged 1 commit into
mainfrom
feat/agent-session-self-service-107237
Jul 15, 2026
Merged

steipete merged 1 commit into
mainfrom
feat/agent-session-self-service-107237

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Phase 1 of #107237 (stacked on #107320). Agents cannot manage their own sessions: no rename/pin/archive, no group management, no way to start a user-visible session (with or without a worktree), no unified view of background work, no cost visibility, and a bad self-selected model switch permanently nerfs the session.

Why This Change Was Made

  • New grouped sessions tool (owner-gated): patch (label/pinned/archived/model/thinkingLevel, own session tree only) + global group_list/group_set/group_rename/group_delete. Reset/delete/compact are deliberately absent from the action enum.
  • sessions_spawn gains visible: true (+ worktree/worktreeName/worktreeBaseRef): routes through sessions.create (the task-suggestion-accept precedent) so the child is a real dashboard session with a session-owned worktree; completion-announce contract kept via the subagent registry; admission reservation enforces max-children; failed starts roll back with abort-confirmed deletion only. Depth/target-policy/sandbox rules reused from the hidden path; cwd/execNode stay unexposed (admin-scope boundary).
  • subagents tool now reads the unified task_runs ledger, tree-scoped: subagent, acp, media-generation, and cron runs in one list, plus cancel for tasks inside the caller's tree.
  • session_status gains a timeout-guarded cost/tokens line from the session-cost cache (cost partial marker when incomplete; omitted when cold).
  • Model self-patch safety: patches from the agent's own sessions tool record a fallback marker (in-process gateway origin only — external transports cannot claim it). A following run failing with auth/billing/model_not_found reverts to the previous working model and leaves a system note. Transient provider states (rate_limit/overloaded/timeout/server_error) never revert. Marker clears on first success; user-initiated switches are untouched.

User Impact

Agents can retitle/pin/archive/group sessions, switch their own session model safely, start visible worktree sessions the user can watch, see and cancel all background work in their tree, and report session cost in status.

Evidence

  • Focused suites green (local node scripts/run-vitest.mjs): sessions tool, sessions-spawn (visible+worktree matrix incl. rollback/announce/depth/sandbox), subagents ledger view + cancel, status cost line, sessions.patch marker atomicity, cross-agent depth — 181 tests.
  • Remote Testbox (implementer run): tsgo core + core:test, touched-file oxlint, plugin SDK surface gate — green.
  • Codex structured review clean; reviewer refinement applied: revert-reason set trimmed to definitive failures.

@steipete
steipete requested a review from a team as a code owner July 14, 2026 12:49
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Jul 14, 2026
@steipete
steipete force-pushed the feat/openclaw-system-agent-rename-107237 branch from 332ed32 to af570bd Compare July 14, 2026 15:40
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 14, 2026
@clawsweeper

clawsweeper Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 14, 2026, 12:04 PM ET / 16:04 UTC.

Summary
Adds an owner-gated sessions management tool, visible worktree session spawning, unified background-task listing and cancellation, session cost reporting, and guarded rollback of agent-selected models.

Reproducibility: not applicable. as a bug reproduction: this PR adds new agent-facing capabilities. The relevant validation question is whether real owner, non-owner, cross-tree, failure-cleanup, and provider-recovery scenarios behave as designed.

Review metrics: 3 noteworthy metrics.

  • Visible-spawn inputs: 4 added. The new visible, worktree, worktreeName, and worktreeBaseRef inputs cross session creation, repository state, cleanup, and upgrade-sensitive tool-schema behavior.
  • Unified task kinds: 4 represented. The subagents view now spans subagent, ACP, media-generation, and cron runs, so cancellation must preserve each runtime owner's lifecycle contract.
  • Session management actions: 5 exposed. Patch plus four global group actions materially expand the agent-facing mutation surface and require an explicit authority decision.

Stored data model
Persistent data-model change detected: migration/backfill/repair: apps/.i18n/native-source.json, migration/backfill/repair: apps/.i18n/native/ar.json, migration/backfill/repair: apps/.i18n/native/de.json, migration/backfill/repair: apps/.i18n/native/es.json, migration/backfill/repair: apps/.i18n/native/fa.json, migration/backfill/repair: apps/.i18n/native/fr.json, and 18 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #107237
Summary: This PR is the Phase 1 implementation candidate for the canonical two-tier agent-capabilities issue and is stacked on the separate Phase 0 rename PR.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🐚 platinum hermit
Patch quality: 🦐 gold shrimp
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Resolve the stacked-base conflict and rerun the relevant exact-head checks.
  • Provide live evidence for visible worktree success and rollback cleanup, cross-tree cancellation denial, and definitive-versus-transient model failure handling.
  • Obtain explicit maintainer approval for global group mutations and automatic model recovery.

Risk before merge

  • [P1] The new tool can mutate global session groups and cancel task-ledger entries; maintainers should confirm that owner gating plus tree checks are the intended permanent authority boundary for every action.
  • [P1] Automatic rollback after agent-origin model changes mutates persisted session/provider state based on failure classification, so auth, billing, missing-model, success-clearing, restart, and user-initiated-switch cases need explicit upgrade and recovery proof.
  • [P1] Visible worktree spawning crosses session creation, worktree ownership, child-admission reservation, task registration, completion announcement, and failure cleanup; a partial failure could otherwise leave an orphan session, worktree, reservation, or misleading announcement.
  • [P1] The stacked branch is currently conflicted after its base changed, so exact-head correctness and previously green checks must be refreshed against the resolved stack before merge.

Maintainer options:

  1. Refresh the stack and prove boundaries (recommended)
    Resolve the current base conflict, then capture exact-head live evidence that session/worktree cleanup, task-tree cancellation, group mutations, and model rollback preserve their stated authority and state invariants.
  2. Accept the expanded authority model
    Maintainers may explicitly approve global owner-gated group control and automatic model recovery after reviewing the upgrade and security implications.
  3. Pause and split risky capabilities
    If the combined authority surface is too broad to validate safely, retain the umbrella issue and replace this stack layer with smaller independently provable PRs.

Next step before merge

  • [P1] A maintainer should resolve the stacked conflict and decide the permanent authority model before exact-head validation; there is no narrow mechanical defect suitable for an autonomous repair job.

Maintainer decision needed

  • Question: Should Phase 1 permanently allow owner-controlled agents to mutate global session groups, cancel any task inside their session tree, and trigger automatic rollback of their own model selection under the proposed failure rules?
  • Rationale: These are intentional expansions of agent authority and persisted session/provider behavior; source-level correctness cannot determine whether the proposed global, tree-scoped, and automatic boundaries match maintainer product and security intent.
  • Likely owner: steipete — This person authored the umbrella design and has the strongest combined history across the stacked system-agent and session self-service changes.
  • Options:
    • Approve with refreshed proof (recommended): Keep the proposed authority model, resolve the stacked conflict, and require exact-head live proof for global groups, tree cancellation, visible-worktree cleanup, and model rollback before landing.
    • Narrow mutation authority: Limit group operations or cancellation to a smaller session-owned scope and require explicit user action for model recovery before merging.
    • Split the phase: Land read-only status and ledger visibility separately while holding global mutations, cancellation, visible worktrees, and rollback for narrower follow-up reviews.

Security
Needs attention: No malicious or supply-chain change is indicated, but the new global session-group mutations, task cancellation, visible worktree creation, and automatic model rollback materially expand agent authority and require explicit boundary approval.

Review details

Best possible solution:

Land the stacked phases only after rebasing onto the accepted rename head and demonstrating that every new mutation is owner-gated and correctly tree-scoped, visible worktree failures clean up all owned resources, task cancellation cannot cross the caller's tree, and model rollback preserves user-selected settings while recovering only definitive agent-origin failures.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug reproduction: this PR adds new agent-facing capabilities. The relevant validation question is whether real owner, non-owner, cross-tree, failure-cleanup, and provider-recovery scenarios behave as designed.

Is this the best way to solve the issue?

Unclear pending maintainer intent. Reusing sessions.create, task_runs, existing depth/sandbox policy, and the current session store is architecturally preferable to parallel infrastructure, but the combined global-group, cancellation, visible-worktree, and automatic-rollback authority surface may need narrowing or splitting.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8251976cf6c7.

Label changes

Label changes:

  • add P2: This is a substantial but non-emergency feature improving routine agent session operations, with bounded users who opt into agent-driven session management.
  • add merge-risk: 🚨 session-state: The patch mutates labels, pin/archive state, groups, model metadata, visible child sessions, worktrees, and task lifecycle state across several persistence owners.
  • add merge-risk: 🚨 auth-provider: The patch automatically reverts an agent-selected model after classified auth, billing, or model-not-found failures and therefore affects provider and model routing state.
  • add merge-risk: 🚨 security-boundary: The patch grants owner-controlled agents new global group mutations and task cancellation powers whose permanent authorization and tree-scope rules require maintainer confirmation.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The PR carries the protected maintainer label and reports focused local and Testbox verification, so the external-contributor proof gate does not apply; exact-head live boundary proof is still recommended after resolving the stacked conflict.

Label justifications:

  • P2: This is a substantial but non-emergency feature improving routine agent session operations, with bounded users who opt into agent-driven session management.
  • merge-risk: 🚨 session-state: The patch mutates labels, pin/archive state, groups, model metadata, visible child sessions, worktrees, and task lifecycle state across several persistence owners.
  • merge-risk: 🚨 auth-provider: The patch automatically reverts an agent-selected model after classified auth, billing, or model-not-found failures and therefore affects provider and model routing state.
  • merge-risk: 🚨 security-boundary: The patch grants owner-controlled agents new global group mutations and task cancellation powers whose permanent authorization and tree-scope rules require maintainer confirmation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The PR carries the protected maintainer label and reports focused local and Testbox verification, so the external-contributor proof gate does not apply; exact-head live boundary proof is still recommended after resolving the stacked conflict.
Evidence reviewed

Security concerns:

  • [medium] Confirm global session mutation authority
    The feature intentionally lets an owner-controlled agent manage global session groups while other patch and cancellation actions are tree-scoped; maintainers should confirm this asymmetry is the intended permanent authorization model.
    Confidence: 0.82
  • [medium] Verify rollback origin cannot be forged
    The model fallback marker must remain creatable only by the trusted in-process agent-tool path and must not be claimable through external gateway transports, restored stale state, or user-driven session patches.
    Confidence: 0.78

What I checked:

  • Canonical feature relationship: The PR explicitly implements Phase 1 of the open two-tier agent-capabilities plan at [Feature]: Two-tier agent capabilities: session self-service tools + OpenClaw system-agent delegation (Crestodian rename) #107237; the requested session self-service behavior is therefore still active rather than redundant. (357643f4bf05)
  • Stacked dependency: The branch includes the system-agent rename commits and targets the still-open Phase 0 PR at feat(setup): rename Crestodian to OpenClaw system agent #107320 rather than main, so it must be reviewed and landed as a stacked change. (af570bd90739)
  • Existing owner boundaries reused: The design routes visible children through the existing sessions.create implementation, reuses established spawn depth and sandbox rules, reads the canonical task_runs ledger, and deliberately withholds cwd, execNode, reset, delete, and compact from the agent-facing actions. (src/gateway/server-methods/sessions.ts, 357643f4bf05)
  • Validation supplied: The PR reports 181 focused tests plus remote production type checks, test type checks, touched-file lint, and the plugin SDK surface gate; GitHub also reports successful QA smoke, security scanning, CodeQL, build-artifact, and real-behavior-proof checks on the reviewed head. (357643f4bf05)
  • Current merge state: GitHub reports the PR as dirty and not currently mergeable after the stacked base was force-pushed; several aggregate checks failed or were cancelled while most focused lanes succeeded. (357643f4bf05)
  • Session authority precedent: Current-main history includes a focused change requiring administrative authority for session reset, demonstrating that session mutations are deliberately differentiated by risk rather than exposed uniformly. (src/gateway/server-methods/sessions.ts, 50f6a2f136)

Likely related people:

  • steipete: The behavior appears in this contributor's broader system-agent and session self-service design, and repository history also shows repeated work on session identity and gateway behavior beyond merely opening this PR. (role: feature owner and recent area contributor; confidence: high; commits: 357643f4bf05, f22636453dbe, 1dd88c6288; files: src/agents/tools/sessions-spawn-tool.ts, src/gateway/server-methods/sessions.ts, src/system-agent/)
  • vincentkoc: Recent merged history added the administrative boundary for session reset, making this person relevant to deciding which new agent-facing session mutations may remain owner-only or tree-scoped. (role: session authority contributor; confidence: high; commits: 50f6a2f136; files: src/gateway/server-methods/sessions.ts, src/gateway/method-scopes.ts)
  • jalehman: Recent merged work forwarded plugin subagent overrides and repaired late-bound subagent runtime loading, directly adjacent to sessions_spawn and child-runtime behavior. (role: subagent runtime contributor; confidence: medium; commits: 1399ca5fcb, eeb140b4f0; files: src/agents/tools/sessions-spawn-tool.ts, src/agents/subagent-spawn.ts, src/plugins/)
  • obviyus: Recent history includes substantial gateway, dashboard-session, cost, model metadata, lifecycle-event, and session-creation work that overlaps the visible-spawn and status-cost surfaces. (role: recent session and gateway contributor; confidence: medium; commits: 2afd65741c; files: src/gateway/server-methods/sessions.ts, src/agents/tools/session-status-tool.ts, ui/src/pages/tasks/)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete force-pushed the feat/openclaw-system-agent-rename-107237 branch from af570bd to 3e771fc Compare July 14, 2026 18:02
Base automatically changed from feat/openclaw-system-agent-rename-107237 to main July 14, 2026 18:03
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: macos App: macos app: web-ui App: web-ui cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling extensions: anthropic channel: qqbot extensions: qa-lab extensions: codex extensions: copilot labels Jul 14, 2026
@steipete
steipete force-pushed the feat/agent-session-self-service-107237 branch from 357643f to 587dad6 Compare July 14, 2026 18:06
@steipete
steipete force-pushed the feat/agent-session-self-service-107237 branch from 587dad6 to 846cf98 Compare July 14, 2026 20:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 846cf989a2

ℹ️ 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".

Comment on lines +59 to +61
for (const task of tasks) {
if (task.scopeKind !== "session" || visibleTasks.has(task.taskId)) {
continue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include cron task rows when building the tree

When the unified list contains real cron runs, this early scopeKind !== "session" filter drops them before checking childSessionKey. Cron creates task ledger rows with ownerKey: "" and scopeKind: "system" in src/cron/service/task-runs.ts, even when the run is tied to a session via childSessionKey, so subagents({action:"list"}) and cancel will omit exactly the cron work the new tool description promises for the caller's session tree. Allow session-related cron/system rows to be admitted by childSessionKey instead of requiring scopeKind === "session" for every runtime.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the feat/agent-session-self-service-107237 branch from 846cf98 to 92f9d1b Compare July 14, 2026 21:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92f9d1b8eb

ℹ️ 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".

@@ -48,6 +48,7 @@ export const GATEWAY_CONTROL_PLANE_TOOLS = ["cron", "gateway"] as const;
*/
export const GATEWAY_OWNER_ONLY_CORE_TOOLS = [
...GATEWAY_CONTROL_PLANE_TOOLS,
"sessions",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add sessions to the HTTP deny list

Adding sessions only to the owner-only set leaves it available by default to owner-authenticated /tools/invoke requests: shared-secret HTTP auth is treated as owner (src/gateway/http-auth-utils.ts:250-260), and HTTP resolution only default-denies names in DEFAULT_GATEWAY_HTTP_TOOL_DENY before filtering tools (src/gateway/tool-resolution.ts:207-214, src/gateway/tool-resolution.ts:416-422). That means the new tool can patch sessions and mutate the global group catalog over the narrow HTTP automation surface without the explicit gateway.tools.allow opt-in or audit warning used for sessions_spawn/sessions_send; put sessions in the default HTTP deny list as well.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the feat/agent-session-self-service-107237 branch 2 times, most recently from 32ea35c to 4ec7811 Compare July 14, 2026 22:05
@openclaw-barnacle openclaw-barnacle Bot added the app: android App: android label Jul 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ec78115b9

ℹ️ 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".

Comment on lines +35 to +43
sessionKey: Type.Optional(Type.String({ description: "Target session. Default: current" })),
label: Type.Optional(Type.String({ description: "Session label" })),
pinned: Type.Optional(Type.Boolean({ description: "Pin session" })),
archived: Type.Optional(Type.Boolean({ description: "Archive session" })),
model: Type.Optional(Type.String({ description: "Model override" })),
thinkingLevel: Type.Optional(Type.String({ description: "Thinking override" })),
names: Type.Optional(Type.Array(Type.String(), { description: "Ordered group names" })),
name: Type.Optional(Type.String({ description: "Group name" })),
to: Type.Optional(Type.String({ description: "New group name" })),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Expose category in the sessions patch tool

When a user asks the new sessions tool to move the current session into a group, the model has no parameter that can send the membership change: this schema only exposes label/pin/archive/model/thinking, while group membership is stored on each session entry's category (src/gateway/session-groups.ts:1-3) and sessions.patch already accepts that field (src/gateway/sessions-patch.ts:384-398). As a result the tool can create, rename, or delete group catalog entries but cannot actually put a session in one of those groups.

Useful? React with 👍 / 👎.

New grouped sessions tool (patch: label/pin/archive/model/thinking; group
CRUD; owner-gated; no reset/delete/compact). sessions_spawn gains visible +
worktree via sessions.create with admission reservation and abort-confirmed
rollback; a started run with no run id is aborted and deleted rather than
left orphaned. subagents tool reads the unified task_runs ledger tree-scoped
(subagent/acp/media/cron) and cancels detached runs, enforcing the
controlScope gate for leaf callers. session_status gains a cost line.
Agent-origin model patches record a fallback marker; runs failing on
auth/billing/model_not_found revert to the last working model (transient
errors never revert), and an independent thinkingLevel change realigns the
marker so revert cannot clobber it.

Refs #107237
@steipete
steipete force-pushed the feat/agent-session-self-service-107237 branch from 4ec7811 to 92128ce Compare July 14, 2026 23:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92128cece1

ℹ️ 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".

...(params.label ? { label: params.label } : {}),
model: resolvedModel,
task: params.task,
parentSessionKey: requesterKey,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use live run as visible-session parent

When tools are built for sandboxed/channel turns, agentSessionKey can be the sandbox key while completionOwnerKey is the live runSessionKey (src/agents/openclaw-tools.ts:580-583, populated in src/agents/embedded-agent-runner/run/attempt-tool-base-prepare.ts:234-238). Passing the controller key as parentSessionKey makes sessions.create validate and attach the new dashboard session to the sandbox row (src/gateway/session-create-service.ts:333-343); if that row is absent the visible spawn fails as an unknown parent, and if it exists the child is not in the live run's session tree. Use the resolved live/completion requester key for the visible session parent.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant