Files
openclaw/src/agents/subagent-spawn.runtime.ts
Peter Steinberger 38746af071 feat(gateway): let write-scope operators manage chat session organization (#100964)
sessions.patch becomes a params-aware dynamic-scope method: operator.write
now authorizes patches that touch only user-level chat-organization fields
(label, category, pinned, archived, unread); every other field, mixed
patches, and unknown keys keep requiring operator.admin (fail closed).
This unblocks the session controls shipped in #100814 for the Android app,
whose bounded operator session intentionally never requests operator.admin.

Also: session list ordering gains a deterministic key tiebreaker for equal
pinnedAt/updatedAt (stable offset paging and prompt-cache friendliness), a
user-assigned label now beats stored channel-derived display names in the
row projection so renames survive refreshes, and subagent spawn pins its
gateway calls to admin via the params-aware least-privilege resolver
instead of the static admin-only method check (#59428 contract preserved).

Refs #100712
2026-07-06 21:08:26 +01:00

49 lines
1.9 KiB
TypeScript

/**
* Runtime dependency barrel for subagent spawning. Keeping these imports in a
* single module lets spawn tests replace runtime seams without loading the
* entire gateway/channel stack.
*/
export {
DEFAULT_SUBAGENT_MAX_CHILDREN_PER_AGENT,
DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH,
} from "../config/agent-limits.js";
export { getRuntimeConfig } from "../config/config.js";
export { loadSessionStore, mergeSessionEntry, updateSessionStore } from "../config/sessions.js";
export {
forkSessionEntryFromParent,
forkSessionFromParent,
resolveParentForkDecision,
type ParentForkDecision,
} from "../auto-reply/reply/session-fork.js";
export { ensureContextEnginesInitialized } from "../context-engine/init.js";
export { resolveContextEngine } from "../context-engine/registry.js";
export { callGateway } from "../gateway/call.js";
export {
dispatchGatewayMethodInProcess,
hasInProcessGatewayContext,
} from "../gateway/server-plugins.js";
export {
ADMIN_SCOPE,
resolveLeastPrivilegeOperatorScopesForMethod,
} from "../gateway/method-scopes.js";
export { getSessionBindingService } from "../infra/outbound/session-binding-service.js";
export {
pruneLegacyStoreKeys,
resolveGatewaySessionStoreTarget,
} from "../gateway/session-utils.js";
export { getGlobalHookRunner } from "../plugins/hook-runner-global.js";
export { emitSessionLifecycleEvent } from "../sessions/session-lifecycle-events.js";
export {
mergeDeliveryContext,
normalizeDeliveryContext,
} from "../utils/delivery-context.shared.js";
export { resolveAgentConfig } from "./agent-scope.js";
export { AGENT_LANE_SUBAGENT } from "./lanes.js";
export { resolveSandboxRuntimeStatus } from "./sandbox/runtime-status.js";
export { buildSubagentSystemPrompt } from "./subagent-system-prompt.js";
export {
resolveDisplaySessionKey,
resolveInternalSessionKey,
resolveMainSessionAlias,
} from "./tools/sessions-helpers.js";