@gajae-code/coding-agent 0.18.7 → 0.18.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +279 -1
- package/dist/types/async/job-manager.d.ts +1 -1
- package/dist/types/capability/mcp.d.ts +2 -0
- package/dist/types/capability/skill.d.ts +2 -0
- package/dist/types/capability/types.d.ts +2 -0
- package/dist/types/cli/public-command-errors.d.ts +3 -1
- package/dist/types/cli/setup-cli.d.ts +1 -1
- package/dist/types/commands/deep-interview.d.ts +3 -0
- package/dist/types/config/autorouting-tier-map.d.ts +348 -9
- package/dist/types/config/file-lock.d.ts +1 -0
- package/dist/types/config/model-bindings-applier.d.ts +2 -0
- package/dist/types/config/model-profile-activation.d.ts +11 -3
- package/dist/types/config/model-registry.d.ts +4 -9
- package/dist/types/config/skill-settings-defaults.d.ts +2 -0
- package/dist/types/cursor-delete-path.d.ts +1 -0
- package/dist/types/cursor-mcp-name.d.ts +8 -0
- package/dist/types/customization/inventory.d.ts +2 -0
- package/dist/types/debug/report-bundle-parent.d.ts +2 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/stream.d.ts +1 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/version-manager.d.ts +31 -0
- package/dist/types/defaults/gjc-skills.generated.d.ts +5 -6
- package/dist/types/discovery/helpers.d.ts +6 -1
- package/dist/types/export/html/css-color.d.ts +2 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/extensibility/extensions/types.d.ts +7 -0
- package/dist/types/extensibility/gjc-plugins/runtime-adapters.d.ts +14 -1
- package/dist/types/extensibility/plugins/marketplace/cache.d.ts +2 -0
- package/dist/types/extensibility/plugins/plugin-link-path.d.ts +2 -0
- package/dist/types/extensibility/runtime-skill-discovery.d.ts +3 -1
- package/dist/types/extensibility/skill-management.d.ts +3 -1
- package/dist/types/extensibility/skills.d.ts +2 -0
- package/dist/types/gjc-runtime/deep-interview-crystallize.d.ts +74 -0
- package/dist/types/gjc-runtime/deep-interview-runtime.d.ts +11 -0
- package/dist/types/gjc-runtime/gc-runtime.d.ts +5 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +0 -5
- package/dist/types/gjc-runtime/state-argv.d.ts +1 -1
- package/dist/types/gjc-runtime/state-migrations.d.ts +8 -0
- package/dist/types/gjc-runtime/state-runtime.d.ts +95 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +11 -1
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +8 -0
- package/dist/types/internal-urls/skill-path.d.ts +1 -0
- package/dist/types/lsp/workspace-path.d.ts +1 -0
- package/dist/types/modes/acp/acp-agent.d.ts +7 -0
- package/dist/types/modes/components/custom-editor.d.ts +6 -0
- package/dist/types/modes/components/customization/customization-dashboard.d.ts +1 -0
- package/dist/types/modes/components/extensions/state-manager.d.ts +4 -3
- package/dist/types/modes/controllers/input-controller.d.ts +9 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/utils/interrupt-ownership.d.ts +3 -0
- package/dist/types/modes/utils/keybinding-matchers.d.ts +1 -0
- package/dist/types/modes/utils/macos-option-forwarding.d.ts +17 -0
- package/dist/types/progress/collect-project-progress.d.ts +38 -0
- package/dist/types/progress/progress-contract.d.ts +154 -0
- package/dist/types/progress/progress-snapshot.d.ts +11 -0
- package/dist/types/progress/project-progress.d.ts +141 -0
- package/dist/types/progress/render-progress.d.ts +28 -0
- package/dist/types/runtime-mcp/oauth-public-url.d.ts +1 -0
- package/dist/types/runtime-mcp/plugin-network-boundary.d.ts +1 -0
- package/dist/types/runtime-mcp/smithery-registry.d.ts +24 -0
- package/dist/types/runtime-mcp/types.d.ts +6 -0
- package/dist/types/sdk/acp/adapter.d.ts +1 -1
- package/dist/types/sdk/broker/broker-exit.d.ts +6 -2
- package/dist/types/sdk/broker/broker.d.ts +18 -1
- package/dist/types/sdk/broker/session-index.d.ts +12 -6
- package/dist/types/sdk/bus/index.d.ts +12 -1
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +6 -1
- package/dist/types/sdk/client/client.d.ts +2 -0
- package/dist/types/sdk/host/query/handlers.d.ts +3 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/router/session-router.d.ts +2 -0
- package/dist/types/sdk/session-list.d.ts +1 -1
- package/dist/types/sdk/session.d.ts +8 -0
- package/dist/types/session/agent-session.d.ts +38 -9
- package/dist/types/session/artifacts.d.ts +2 -2
- package/dist/types/session/internal/managed-gc-retirement-codec.d.ts +32 -0
- package/dist/types/session/internal/managed-session-scope.d.ts +79 -2
- package/dist/types/session/internal/managed-session-storage.d.ts +26 -1
- package/dist/types/session/internal/managed-task-owner-cleanup.d.ts +62 -0
- package/dist/types/session/internal/task-artifact-owner-access.d.ts +2 -0
- package/dist/types/session/internal/task-artifact-owner-transcript.d.ts +9 -1
- package/dist/types/session/session-manager.d.ts +31 -5
- package/dist/types/session/session-retirement.d.ts +31 -7
- package/dist/types/session/session-storage.d.ts +62 -2
- package/dist/types/session/task-artifact-owner-codec.d.ts +2 -0
- package/dist/types/setup/credential-auto-import.d.ts +1 -1
- package/dist/types/setup/credential-import.d.ts +6 -4
- package/dist/types/skill-state/active-state.d.ts +38 -0
- package/dist/types/slash-commands/helpers/progress-report.d.ts +8 -0
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/tools/bash-skill-urls.d.ts +1 -1
- package/dist/types/tools/index.d.ts +3 -0
- package/dist/types/tools/python.d.ts +9 -1
- package/dist/types/tools/recipe/recipe-guard.d.ts +7 -0
- package/dist/types/tools/restricted-cwd.d.ts +1 -0
- package/dist/types/tools/todo-write.d.ts +6 -0
- package/dist/types/utils/tools-checksum.d.ts +7 -0
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +21 -0
- package/scripts/verify-managed-empty-stop.ts +28 -0
- package/src/async/job-manager.ts +228 -122
- package/src/capability/index.ts +17 -0
- package/src/capability/mcp.ts +2 -0
- package/src/capability/skill.ts +2 -0
- package/src/capability/types.ts +2 -0
- package/src/cli/auth-broker-cli.ts +1 -1
- package/src/cli/customize-doctor.ts +15 -2
- package/src/cli/public-command-errors.ts +21 -1
- package/src/cli/setup-cli.ts +4 -4
- package/src/cli/skills-cli.ts +5 -0
- package/src/commands/deep-interview.ts +47 -8
- package/src/commands/sdk.ts +28 -8
- package/src/config/autorouting-tier-map.ts +117 -7
- package/src/config/file-lock.ts +307 -68
- package/src/config/mcp-schema.json +4 -0
- package/src/config/model-bindings-applier.ts +20 -0
- package/src/config/model-profile-activation.ts +240 -46
- package/src/config/model-registry.ts +47 -153
- package/src/config/skill-settings-defaults.ts +7 -0
- package/src/coordinator-mcp/policy.ts +3 -2
- package/src/cursor-delete-path.ts +10 -0
- package/src/cursor-mcp-name.ts +15 -0
- package/src/cursor.ts +13 -2
- package/src/customization/inventory.ts +3 -0
- package/src/debug/report-bundle-parent.ts +22 -0
- package/src/debug/report-bundle.ts +3 -0
- package/src/debug/system-info.ts +13 -1
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/stream.ts +67 -4
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/version-manager.ts +80 -0
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +105 -10
- package/src/defaults/gjc/skills/ralplan/SKILL.md +6 -4
- package/src/defaults/gjc-defaults.test.ts +18 -1
- package/src/defaults/gjc-defaults.ts +3 -0
- package/src/defaults/gjc-skills.generated.ts +58 -36
- package/src/discovery/agents.ts +6 -1
- package/src/discovery/builtin.ts +10 -0
- package/src/discovery/helpers.ts +159 -20
- package/src/discovery/mcp-json.ts +6 -0
- package/src/discovery/ssh.ts +1 -1
- package/src/discovery/substitute-plugin-root.ts +3 -1
- package/src/edit/file-read-cache.ts +1 -1
- package/src/eval/py/executor.ts +380 -120
- package/src/export/html/css-color.ts +9 -0
- package/src/export/html/index.ts +5 -4
- package/src/export/html/template.generated.ts +1 -1
- package/src/extensibility/extensions/runner.ts +4 -0
- package/src/extensibility/extensions/types.ts +7 -0
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +73 -8
- package/src/extensibility/plugins/manager.ts +3 -2
- package/src/extensibility/plugins/marketplace/cache.ts +15 -0
- package/src/extensibility/plugins/marketplace/manager.ts +11 -3
- package/src/extensibility/plugins/plugin-link-path.ts +12 -0
- package/src/extensibility/runtime-skill-discovery.ts +20 -2
- package/src/extensibility/skill-management.ts +6 -2
- package/src/extensibility/skills.ts +6 -1
- package/src/gjc-runtime/deep-interview-crystallize.ts +1814 -0
- package/src/gjc-runtime/deep-interview-recorder.ts +20 -2
- package/src/gjc-runtime/deep-interview-runtime.ts +1415 -13
- package/src/gjc-runtime/deep-interview-stage.ts +98 -21
- package/src/gjc-runtime/gc-runtime.ts +206 -9
- package/src/gjc-runtime/launch-worktree.ts +14 -4
- package/src/gjc-runtime/ralplan-runtime.ts +447 -52
- package/src/gjc-runtime/state-argv.ts +2 -0
- package/src/gjc-runtime/state-migrations.ts +91 -29
- package/src/gjc-runtime/state-runtime.ts +3716 -135
- package/src/gjc-runtime/state-writer.ts +83 -8
- package/src/gjc-runtime/ultragoal-runtime.ts +16 -4
- package/src/gjc-runtime/workflow-manifest.generated.json +70 -42
- package/src/gjc-runtime/workflow-manifest.ts +54 -21
- package/src/harness-control-plane/operate.ts +12 -4
- package/src/harness-control-plane/owner.ts +5 -1
- package/src/hashline/parser.ts +48 -9
- package/src/hashline/recovery.ts +13 -4
- package/src/internal-urls/docs-index.generated.ts +18 -17
- package/src/internal-urls/skill-path.ts +19 -0
- package/src/internal-urls/skill-protocol.ts +2 -0
- package/src/lsp/edits.ts +6 -0
- package/src/lsp/workspace-path.ts +51 -0
- package/src/main.ts +195 -31
- package/src/modes/acp/acp-agent.ts +88 -4
- package/src/modes/components/custom-editor.ts +14 -0
- package/src/modes/components/customization/customization-dashboard.ts +12 -0
- package/src/modes/components/extensions/extension-dashboard.ts +2 -2
- package/src/modes/components/extensions/state-manager.ts +15 -5
- package/src/modes/components/model-selector.ts +1 -4
- package/src/modes/components/provider-onboarding-selector.ts +1 -1
- package/src/modes/components/status-line/segments.ts +4 -0
- package/src/modes/controllers/event-controller.ts +11 -4
- package/src/modes/controllers/input-controller.ts +74 -29
- package/src/modes/controllers/runtime-mcp-command-controller.ts +8 -3
- package/src/modes/controllers/selector-controller.ts +28 -15
- package/src/modes/interactive-mode.ts +4 -0
- package/src/modes/runtime-init.ts +4 -0
- package/src/modes/utils/abort-message.ts +3 -1
- package/src/modes/utils/interrupt-ownership.ts +12 -0
- package/src/modes/utils/keybinding-matchers.ts +4 -0
- package/src/modes/utils/macos-option-forwarding.ts +80 -0
- package/src/progress/collect-project-progress.ts +153 -0
- package/src/progress/progress-contract.ts +172 -0
- package/src/progress/progress-snapshot.ts +140 -0
- package/src/progress/project-progress.ts +446 -0
- package/src/progress/render-progress.ts +209 -0
- package/src/prompts/system/master-mode.md +1 -0
- package/src/prompts/tools/skill-discovery.md +1 -1
- package/src/runtime-mcp/config-writer.ts +10 -6
- package/src/runtime-mcp/config.ts +1 -0
- package/src/runtime-mcp/oauth-flow.ts +5 -0
- package/src/runtime-mcp/oauth-public-url.ts +8 -0
- package/src/runtime-mcp/plugin-network-boundary.ts +4 -0
- package/src/runtime-mcp/smithery-registry.ts +22 -3
- package/src/runtime-mcp/transports/http.ts +2 -2
- package/src/runtime-mcp/types.ts +6 -0
- package/src/sdk/acp/adapter.ts +93 -8
- package/src/sdk/broker/broker-exit.ts +52 -23
- package/src/sdk/broker/broker.ts +75 -6
- package/src/sdk/broker/ensure.ts +2 -0
- package/src/sdk/broker/lifecycle.ts +711 -66
- package/src/sdk/broker/session-index.ts +191 -81
- package/src/sdk/bus/chat-daemon-cli.ts +38 -1
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/index.ts +238 -43
- package/src/sdk/bus/telegram-daemon-contract.ts +6 -1
- package/src/sdk/cli/session-cli.ts +17 -3
- package/src/sdk/client/client.ts +28 -8
- package/src/sdk/host/query/handlers.ts +9 -1
- package/src/sdk/host/session-runtime.test.ts +2647 -294
- package/src/sdk/host/session-runtime.ts +426 -109
- package/src/sdk/host/surface-policy.ts +1 -0
- package/src/sdk/index.ts +8 -0
- package/src/sdk/lifecycle-session.ts +3 -1
- package/src/sdk/prompt-deadline-manager.ts +15 -0
- package/src/sdk/protocol/operation-inventory.generated.json +146 -0
- package/src/sdk/protocol/operation-registry.ts +9 -2
- package/src/sdk/router/session-router.ts +75 -12
- package/src/sdk/session-list.ts +1 -0
- package/src/sdk/session.ts +67 -38
- package/src/session/agent-session.ts +623 -224
- package/src/session/artifacts.ts +174 -70
- package/src/session/internal/managed-gc-retirement-codec.ts +319 -0
- package/src/session/internal/managed-session-scope.ts +3457 -462
- package/src/session/internal/managed-session-storage.ts +376 -61
- package/src/session/internal/managed-task-owner-cleanup.ts +473 -0
- package/src/session/internal/task-artifact-owner-access.ts +19 -3
- package/src/session/internal/task-artifact-owner-transcript.ts +547 -1
- package/src/session/session-manager.ts +939 -133
- package/src/session/session-retirement.ts +573 -14
- package/src/session/session-storage.ts +417 -14
- package/src/session/task-artifact-owner-codec.ts +71 -8
- package/src/session/task-artifact-owner-retirement.ts +21 -19
- package/src/setup/credential-auto-import.ts +12 -3
- package/src/setup/credential-import.ts +176 -5
- package/src/setup/paseo/announce.ts +6 -1
- package/src/skill-state/active-state.ts +132 -2
- package/src/slash-commands/builtin-registry.ts +39 -9
- package/src/slash-commands/helpers/progress-report.ts +23 -0
- package/src/stt/setup.ts +3 -5
- package/src/task/commands.ts +3 -1
- package/src/task/executor.ts +4 -0
- package/src/task/index.ts +6 -0
- package/src/tools/ask.ts +205 -6
- package/src/tools/ast-edit.ts +4 -0
- package/src/tools/bash-allowed-prefixes.ts +15 -0
- package/src/tools/bash-skill-urls.ts +56 -3
- package/src/tools/bash.ts +48 -79
- package/src/tools/descriptors.ts +5 -1
- package/src/tools/eval.ts +56 -36
- package/src/tools/image-gen.ts +1 -1
- package/src/tools/index.ts +3 -0
- package/src/tools/python.ts +187 -66
- package/src/tools/recipe/index.ts +9 -0
- package/src/tools/recipe/recipe-guard.ts +19 -0
- package/src/tools/restricted-cwd.ts +10 -0
- package/src/tools/skill-discovery.ts +5 -0
- package/src/tools/skill.ts +28 -1
- package/src/tools/todo-write.ts +10 -1
- package/src/tools/tool-catalog.generated.ts +1 -1
- package/src/tools/write.ts +1 -0
- package/src/utils/tools-checksum.ts +34 -0
- package/src/utils/tools-manager.ts +24 -6
- package/src/web/search/providers/codex.ts +3 -2
package/src/sdk/session.ts
CHANGED
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
resolveMissingSessionModelRecovery,
|
|
66
66
|
} from "../config/model-profile-activation";
|
|
67
67
|
import { resolveModelProfileName } from "../config/model-profile-contract";
|
|
68
|
+
import type { ModelProfileOwnershipMarker } from "../config/model-profile-ownership";
|
|
68
69
|
import { resolveProfileBindings } from "../config/model-profiles";
|
|
69
70
|
import { kNoAuth, ModelRegistry } from "../config/model-registry";
|
|
70
71
|
import {
|
|
@@ -84,12 +85,15 @@ import { Settings, type SkillsSettings } from "../config/settings";
|
|
|
84
85
|
import { resolveEagerTaskDelegation } from "../config/task-delegation";
|
|
85
86
|
import { CursorExecHandlers } from "../cursor";
|
|
86
87
|
import { EditTool } from "../edit";
|
|
88
|
+
import { disposeVmContextsByOwner } from "../eval/js/context-manager";
|
|
89
|
+
import { disposeKernelSessionsByOwner } from "../eval/py/executor";
|
|
87
90
|
import type { MasterModeContext } from "../master-mode/context";
|
|
88
91
|
import { describeFoldReceipt } from "../session/fold-coordinator";
|
|
89
92
|
import type { BashRestrictionProfile } from "../tools/bash-allowed-prefixes";
|
|
90
93
|
import { SearchTool } from "../tools/search";
|
|
91
94
|
import "../discovery";
|
|
92
95
|
import { resolveConfigValue } from "../config/resolve-config-value";
|
|
96
|
+
import { resolveGlobalUserSkillLinkTrust } from "../config/skill-settings-defaults";
|
|
93
97
|
import { getEmbeddedDefaultGjcSkills } from "../defaults/gjc-defaults";
|
|
94
98
|
import { BUNDLED_GROK_BUILD_EXTENSION_ID, getBundledGrokBuildExtensionFactory } from "../defaults/gjc-grok-cli";
|
|
95
99
|
import { initializeWithSettings, releaseSettingsScope } from "../discovery";
|
|
@@ -183,7 +187,7 @@ import { AgentSession, type ForkContextSeed, isSessionDisposalIncompleteError }
|
|
|
183
187
|
import { AuthBrokerClient, AuthStorage, RemoteAuthCredentialStore } from "../session/auth-storage";
|
|
184
188
|
import { type CustomMessage, convertToLlm } from "../session/messages";
|
|
185
189
|
import { primaryControlSurfaceFor } from "../session/primary-control-surface";
|
|
186
|
-
import { createReadonlySessionManager, SessionManager } from "../session/session-manager";
|
|
190
|
+
import { createReadonlySessionManager, SessionManager, sessionArtifactCapability } from "../session/session-manager";
|
|
187
191
|
import {
|
|
188
192
|
parsePersistedCredentialSelector,
|
|
189
193
|
resolveStartupAuthConfig,
|
|
@@ -490,6 +494,8 @@ export interface CreateAgentSessionOptions {
|
|
|
490
494
|
modelPattern?: string;
|
|
491
495
|
/** Active profile inherited by a nested SDK/subagent session. */
|
|
492
496
|
activeModelProfile?: string;
|
|
497
|
+
/** Model profile ownership marker for propagating parent profile ownership to subagent sessions. */
|
|
498
|
+
modelProfileOwnershipMarker?: ModelProfileOwnershipMarker;
|
|
493
499
|
/** Thinking selector. Default: from settings, else unset */
|
|
494
500
|
thinkingLevel?: ThinkingLevel;
|
|
495
501
|
/** Runtime substitution metadata for the initial model_change session event. */
|
|
@@ -589,6 +595,12 @@ export interface CreateAgentSessionOptions {
|
|
|
589
595
|
*/
|
|
590
596
|
deferOptionalModelRefresh?: boolean;
|
|
591
597
|
|
|
598
|
+
/**
|
|
599
|
+
* Defer model profile activation until explicit model pin validation occurs.
|
|
600
|
+
* @internal Lifecycle-only: prevents default profile activation before pin resolution.
|
|
601
|
+
*/
|
|
602
|
+
deferModelProfileActivation?: boolean;
|
|
603
|
+
|
|
592
604
|
/** Enable LSP integration (tool, formatting, diagnostics, warmup). Default: true */
|
|
593
605
|
enableLsp?: boolean;
|
|
594
606
|
/** Skip Python kernel availability check and prelude warmup */
|
|
@@ -2076,6 +2088,12 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
2076
2088
|
const hasThinkingEntry = existingBranch.some(entry => entry.type === "thinking_level_change");
|
|
2077
2089
|
const hasServiceTierEntry = existingBranch.some(entry => entry.type === "service_tier_change");
|
|
2078
2090
|
|
|
2091
|
+
// Apply inherited model profile ownership marker to subagent sessions when a parent provides one.
|
|
2092
|
+
// This must occur after computing hasExistingSession to avoid marking a fresh session as resumed.
|
|
2093
|
+
if (options.modelProfileOwnershipMarker !== undefined) {
|
|
2094
|
+
sessionManager.appendModelProfileOwnershipMarker(options.modelProfileOwnershipMarker);
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2079
2097
|
for (const entry of existingBranch) {
|
|
2080
2098
|
if (entry.type !== "custom" || entry.customType !== "auth-credential-pin") continue;
|
|
2081
2099
|
const data = entry.data;
|
|
@@ -2415,6 +2433,10 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
2415
2433
|
profileAuthority,
|
|
2416
2434
|
cwd,
|
|
2417
2435
|
disabledExtensions: settings.get("disabledExtensions"),
|
|
2436
|
+
allowExternalUserSkillSymlinks: resolveGlobalUserSkillLinkTrust({
|
|
2437
|
+
trustUserSkills: settings.getGlobal("skills.trustUserSkills"),
|
|
2438
|
+
enablePiUser: settings.getGlobal("skills.enablePiUser"),
|
|
2439
|
+
}),
|
|
2418
2440
|
});
|
|
2419
2441
|
skills = withEmbeddedDefaultGjcSkills(skillsResult.skills);
|
|
2420
2442
|
skillWarnings = skillsResult.warnings;
|
|
@@ -3193,9 +3215,18 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
3193
3215
|
getSessionFile: () => sessionManager.getSessionFile() ?? null,
|
|
3194
3216
|
getSessionAgentDir: () => session?.getSessionAgentDir() ?? options.agentDir ?? settings.getAgentDir(),
|
|
3195
3217
|
getEvalKernelOwnerId: () => evalKernelOwnerId,
|
|
3196
|
-
assertEvalExecutionAllowed: () =>
|
|
3197
|
-
|
|
3198
|
-
session
|
|
3218
|
+
assertEvalExecutionAllowed: () => {
|
|
3219
|
+
if (!session) throw new Error("Eval execution is unavailable until session initialization completes");
|
|
3220
|
+
session.assertEvalExecutionAllowed();
|
|
3221
|
+
},
|
|
3222
|
+
trackEvalExecution: (execution, abortController) => {
|
|
3223
|
+
if (!session) {
|
|
3224
|
+
abortController.abort(new Error("Eval execution is unavailable until session initialization completes"));
|
|
3225
|
+
void execution.catch(() => {});
|
|
3226
|
+
throw new Error("Eval execution is unavailable until session initialization completes");
|
|
3227
|
+
}
|
|
3228
|
+
return session.trackEvalExecution(execution, abortController);
|
|
3229
|
+
},
|
|
3199
3230
|
getAsyncJobManager: () => asyncJobManager,
|
|
3200
3231
|
waitForUserSteering: signal => {
|
|
3201
3232
|
if (agent) return agent.waitForSteeringArrival(signal);
|
|
@@ -3278,19 +3309,21 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
3278
3309
|
peekQueueInvoker: () => session.peekQueueInvoker(),
|
|
3279
3310
|
peekStandingResolveHandler: () => session.peekStandingResolveHandler(),
|
|
3280
3311
|
setStandingResolveHandler: handler => session.setStandingResolveHandler(handler),
|
|
3281
|
-
allocateOutputArtifact:
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
}
|
|
3312
|
+
allocateOutputArtifact: toolType => sessionManager.allocateArtifactPath(toolType),
|
|
3313
|
+
captureArtifactPublication: () => {
|
|
3314
|
+
const capability = sessionArtifactCapability(sessionManager);
|
|
3315
|
+
if (!capability) throw new Error("Session artifact publication authority is unavailable.");
|
|
3316
|
+
return capability.captureArtifactPublication();
|
|
3287
3317
|
},
|
|
3288
3318
|
getArtifactManager: () => sessionManager.getArtifactManager(),
|
|
3289
3319
|
isArtifactManagerAuthorized: manager => sessionManager.isArtifactManagerAuthorized(manager),
|
|
3290
3320
|
adoptArtifactManager: manager => sessionManager.adoptArtifactManager(manager),
|
|
3291
3321
|
releaseArtifactManager: manager => sessionManager.releaseArtifactManager(manager),
|
|
3292
3322
|
ensureArtifactManager: () => sessionManager.ensureArtifactManager(),
|
|
3293
|
-
registerSessionCleanup: cleanup =>
|
|
3323
|
+
registerSessionCleanup: cleanup => {
|
|
3324
|
+
if (!session) throw new Error("Cannot register session cleanup before session initialization completes");
|
|
3325
|
+
return session.registerToolSessionTransitionCleanup(cleanup);
|
|
3326
|
+
},
|
|
3294
3327
|
mcpConfigPath: explicitMcpConfigPath,
|
|
3295
3328
|
settings,
|
|
3296
3329
|
authStorage,
|
|
@@ -4028,6 +4061,14 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
4028
4061
|
// INTERNAL terminal-abort seams, threaded directly from the
|
|
4029
4062
|
// owning session (NOT on the public extension context).
|
|
4030
4063
|
terminalAbortSeams: {
|
|
4064
|
+
getTerminalRunOwnerForEvent: event => {
|
|
4065
|
+
if (!session) throw new Error("Terminal owner session is not initialized.");
|
|
4066
|
+
return session.getTerminalRunOwnerForEvent(event);
|
|
4067
|
+
},
|
|
4068
|
+
getRunOwnerDomain: handle => {
|
|
4069
|
+
if (!session) throw new Error("Terminal owner session is not initialized.");
|
|
4070
|
+
return session.getRunOwnerDomain(handle);
|
|
4071
|
+
},
|
|
4031
4072
|
getTerminalTurnEpoch: () => {
|
|
4032
4073
|
if (!session) throw new Error("Terminal abort session is not initialized.");
|
|
4033
4074
|
return session.getTerminalTurnEpoch();
|
|
@@ -4444,19 +4485,6 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
4444
4485
|
// Re-resolve the allowed set: extension factories above may have
|
|
4445
4486
|
// registered providers/models that weren't visible at startup.
|
|
4446
4487
|
const allowedFallbackCandidates = await resolveAllowedModels(modelRegistry, settings, modelMatchPreferences);
|
|
4447
|
-
// A fresh provider discovery can disprove a bundled model while the
|
|
4448
|
-
// general available catalog retains it for offline/profile compatibility.
|
|
4449
|
-
// Exclude only those positively disproved bundled entries from the
|
|
4450
|
-
// unconfigured startup path; explicit model/profile resolution above keeps
|
|
4451
|
-
// its existing precedence and semantics.
|
|
4452
|
-
const profileAvailableKeys = new Set(
|
|
4453
|
-
modelRegistry
|
|
4454
|
-
.getAvailableForProfileActivation()
|
|
4455
|
-
.map(candidate => `${candidate.provider}\u0000${candidate.id}`),
|
|
4456
|
-
);
|
|
4457
|
-
const fallbackCandidates = allowedFallbackCandidates.filter(candidate =>
|
|
4458
|
-
profileAvailableKeys.has(`${candidate.provider}\u0000${candidate.id}`),
|
|
4459
|
-
);
|
|
4460
4488
|
// Candidate order is not a quality signal: catalogs sort retired models
|
|
4461
4489
|
// ahead of current ones whenever their IDs carry older date suffixes, so
|
|
4462
4490
|
// an unconfigured install would otherwise start on a model its provider
|
|
@@ -4464,7 +4492,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
4464
4492
|
// first — the same table `findInitialModel` consults — and only then fall
|
|
4465
4493
|
// back to catalog order.
|
|
4466
4494
|
for (const candidate of orderByProviderDefaultFirst(
|
|
4467
|
-
|
|
4495
|
+
allowedFallbackCandidates,
|
|
4468
4496
|
modelRegistry.automaticProviderOrder(credentialSessionId),
|
|
4469
4497
|
)) {
|
|
4470
4498
|
if (await hasModelApiKey(candidate)) {
|
|
@@ -5386,6 +5414,10 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
5386
5414
|
profileAuthority,
|
|
5387
5415
|
cwd: reloadCwd,
|
|
5388
5416
|
disabledExtensions: settings.get("disabledExtensions"),
|
|
5417
|
+
allowExternalUserSkillSymlinks: resolveGlobalUserSkillLinkTrust({
|
|
5418
|
+
trustUserSkills: settings.getGlobal("skills.trustUserSkills"),
|
|
5419
|
+
enablePiUser: settings.getGlobal("skills.enablePiUser"),
|
|
5420
|
+
}),
|
|
5389
5421
|
});
|
|
5390
5422
|
return { skills: withEmbeddedDefaultGjcSkills(reloaded.skills), warnings: reloaded.warnings };
|
|
5391
5423
|
}
|
|
@@ -5452,7 +5484,10 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
5452
5484
|
forkContextSeed: options.forkContextSeed,
|
|
5453
5485
|
providerSessionState: options.providerSessionState,
|
|
5454
5486
|
});
|
|
5455
|
-
|
|
5487
|
+
// Defer profile activation until explicit model pin validation occurs (#5919).
|
|
5488
|
+
if (!options.deferModelProfileActivation) {
|
|
5489
|
+
session.setActiveModelProfile(startupActiveModelProfile);
|
|
5490
|
+
}
|
|
5456
5491
|
if (retainedRecoveryBindingsAfterLateRestore) session.markStartupRecoveryBindingsRequired();
|
|
5457
5492
|
if (recoveredSessionDefault)
|
|
5458
5493
|
session.installRecoveredDefaultFallbackChain(
|
|
@@ -6021,6 +6056,9 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
6021
6056
|
gjcRuntimeSnapshot: gjcRuntimeStore,
|
|
6022
6057
|
};
|
|
6023
6058
|
} catch (error) {
|
|
6059
|
+
// Capture pending owner work before asynchronous startup teardown can yield.
|
|
6060
|
+
const startupPythonCleanup = disposeKernelSessionsByOwner(evalKernelOwnerId);
|
|
6061
|
+
void startupPythonCleanup.catch(() => {});
|
|
6024
6062
|
let cleanupDiagnostic: unknown;
|
|
6025
6063
|
let ownedMcpCleanupFailed = false;
|
|
6026
6064
|
let ownedMcpCleanupError: unknown;
|
|
@@ -6058,6 +6096,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
6058
6096
|
await session.awaitDisposeCompletion();
|
|
6059
6097
|
}
|
|
6060
6098
|
});
|
|
6099
|
+
await attemptCleanup(() => startupPythonCleanup);
|
|
6061
6100
|
} else {
|
|
6062
6101
|
if (hasRegistered)
|
|
6063
6102
|
await attemptCleanup(() => {
|
|
@@ -6082,18 +6121,8 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
6082
6121
|
ownedMcpCleanupFailed = true;
|
|
6083
6122
|
ownedMcpCleanupError = cleanupError;
|
|
6084
6123
|
});
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
try {
|
|
6088
|
-
evalCleanupModules = await evalCleanup;
|
|
6089
|
-
} catch (cleanupError) {
|
|
6090
|
-
recordCleanupFailure(cleanupError);
|
|
6091
|
-
}
|
|
6092
|
-
if (evalCleanupModules) {
|
|
6093
|
-
const [kernelExecutor, contextManager] = evalCleanupModules;
|
|
6094
|
-
await attemptCleanup(() => kernelExecutor.disposeKernelSessionsByOwner(evalKernelOwnerId));
|
|
6095
|
-
await attemptCleanup(() => contextManager.disposeVmContextsByOwner(evalKernelOwnerId));
|
|
6096
|
-
}
|
|
6124
|
+
await attemptCleanup(() => startupPythonCleanup);
|
|
6125
|
+
await attemptCleanup(() => disposeVmContextsByOwner(evalKernelOwnerId));
|
|
6097
6126
|
await attemptCleanup(closeOwnedSettings);
|
|
6098
6127
|
}
|
|
6099
6128
|
if (processCwdClaimed)
|