fix(sessions): restore Control UI /new hooks

Fixes #76957.

Restores the Control UI /new hook lifecycle through an explicit sessions.create emitCommandHooks opt-in, preserving hook-free defaults for programmatic parent-session creates.

Validation:
- pnpm protocol:check
- pnpm test src/gateway/server.sessions.reset-hooks.test.ts ui/src/ui/app-render.helpers.node.test.ts
- pnpm exec oxlint on touched TS files
- pnpm exec oxfmt --check --threads=1 on touched files
- git diff --check
- OPENCLAW_LOCAL_CHECK=1 OPENCLAW_LOCAL_CHECK_MODE=throttled env NODE_OPTIONS=--max-old-space-size=4096 pnpm check:changed
- GitHub PR checks green on 3a446ec78e
- ClawSweeper re-review completed with no blocking findings and security cleared

Duplicate triage:
- #77376, #77004, and #76967 were superseded closed attempts for #76957
- #77562 is a closed duplicate issue
- #77880 mentions #76957 but is not a duplicate of this hook fix
This commit is contained in:
Val Alexander
2026-05-05 21:57:22 -05:00
committed by GitHub
parent 3110c621df
commit 49c4a13231
11 changed files with 215 additions and 1 deletions

View File

@@ -1910,6 +1910,7 @@ public struct SessionsCreateParams: Codable, Sendable {
public let label: String?
public let model: String?
public let parentsessionkey: String?
public let emitcommandhooks: Bool?
public let task: String?
public let message: String?
@@ -1919,6 +1920,7 @@ public struct SessionsCreateParams: Codable, Sendable {
label: String?,
model: String?,
parentsessionkey: String?,
emitcommandhooks: Bool?,
task: String?,
message: String?)
{
@@ -1927,6 +1929,7 @@ public struct SessionsCreateParams: Codable, Sendable {
self.label = label
self.model = model
self.parentsessionkey = parentsessionkey
self.emitcommandhooks = emitcommandhooks
self.task = task
self.message = message
}
@@ -1937,6 +1940,7 @@ public struct SessionsCreateParams: Codable, Sendable {
case label
case model
case parentsessionkey = "parentSessionKey"
case emitcommandhooks = "emitCommandHooks"
case task
case message
}