oh-my-codex 0.18.8 → 0.18.10
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/Cargo.lock +12 -12
- package/Cargo.toml +1 -1
- package/README.md +4 -0
- package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts +2 -0
- package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts.map +1 -0
- package/dist/autopilot/__tests__/deep-interview-gate.test.js +215 -0
- package/dist/autopilot/__tests__/deep-interview-gate.test.js.map +1 -0
- package/dist/autopilot/__tests__/fsm.test.js +3 -0
- package/dist/autopilot/__tests__/fsm.test.js.map +1 -1
- package/dist/autopilot/__tests__/ralplan-gate.test.js +148 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -1
- package/dist/autopilot/deep-interview-gate.d.ts.map +1 -1
- package/dist/autopilot/deep-interview-gate.js +140 -0
- package/dist/autopilot/deep-interview-gate.js.map +1 -1
- package/dist/autopilot/fsm.js +2 -2
- package/dist/autopilot/fsm.js.map +1 -1
- package/dist/cli/__tests__/auth.test.js +37 -2
- package/dist/cli/__tests__/auth.test.js.map +1 -1
- package/dist/cli/__tests__/codex-feature-probe.test.d.ts +2 -0
- package/dist/cli/__tests__/codex-feature-probe.test.d.ts.map +1 -0
- package/dist/cli/__tests__/codex-feature-probe.test.js +46 -0
- package/dist/cli/__tests__/codex-feature-probe.test.js.map +1 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +2 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +288 -6
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +19 -5
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +39 -10
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js +26 -9
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/resume.test.js +50 -1
- package/dist/cli/__tests__/resume.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +6 -2
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-packaging.test.js +45 -2
- package/dist/cli/__tests__/sparkshell-packaging.test.js.map +1 -1
- package/dist/cli/__tests__/team-decompose.test.js +10 -5
- package/dist/cli/__tests__/team-decompose.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +45 -1
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +75 -0
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +214 -17
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +1 -1
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +25 -1
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/codex-feature-probe.d.ts +5 -2
- package/dist/cli/codex-feature-probe.d.ts.map +1 -1
- package/dist/cli/codex-feature-probe.js +25 -9
- package/dist/cli/codex-feature-probe.js.map +1 -1
- package/dist/cli/index.d.ts +39 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +184 -101
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +9 -1
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/team.d.ts +4 -0
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +43 -4
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +29 -0
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/update.d.ts +20 -3
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +265 -23
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +5 -9
- package/dist/cli/version.js.map +1 -1
- package/dist/compat/__tests__/doctor-contract.test.js +12 -1
- package/dist/compat/__tests__/doctor-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/agents-overlay.test.js +1 -0
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +15 -0
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/code-review-skill-contract.test.js +7 -3
- package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +46 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/skill-guidance-contract.test.js +14 -5
- package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -1
- package/dist/hooks/agents-overlay.d.ts.map +1 -1
- package/dist/hooks/agents-overlay.js +2 -1
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.js +112 -1
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.js.map +1 -1
- package/dist/hooks/extensibility/plugin-runner-stdin.d.ts +2 -0
- package/dist/hooks/extensibility/plugin-runner-stdin.d.ts.map +1 -0
- package/dist/hooks/extensibility/plugin-runner-stdin.js +16 -0
- package/dist/hooks/extensibility/plugin-runner-stdin.js.map +1 -0
- package/dist/hooks/extensibility/plugin-runner.js +2 -4
- package/dist/hooks/extensibility/plugin-runner.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +23 -2
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +387 -0
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +28 -0
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/tmux.test.js +118 -7
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/index.d.ts +6 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +12 -3
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/reconcile.d.ts +6 -2
- package/dist/hud/reconcile.d.ts.map +1 -1
- package/dist/hud/reconcile.js +58 -28
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +4 -18
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/tmux.d.ts +14 -1
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +129 -15
- package/dist/hud/tmux.js.map +1 -1
- package/dist/question/__tests__/renderer.test.js +566 -1
- package/dist/question/__tests__/renderer.test.js.map +1 -1
- package/dist/question/renderer.d.ts +9 -1
- package/dist/question/renderer.d.ts.map +1 -1
- package/dist/question/renderer.js +246 -70
- package/dist/question/renderer.js.map +1 -1
- package/dist/ralplan/consensus-gate.js +9 -1
- package/dist/ralplan/consensus-gate.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +322 -15
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/run-test-files.test.js +115 -1
- package/dist/scripts/__tests__/run-test-files.test.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +94 -20
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.js +54 -21
- package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -1
- package/dist/scripts/run-test-files.js +218 -160
- package/dist/scripts/run-test-files.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +463 -0
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/team/__tests__/delivery-log.test.js +18 -0
- package/dist/team/__tests__/delivery-log.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +48 -0
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +107 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.d.ts.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.js +14 -2
- package/dist/team/__tests__/tmux-test-fixture.js.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.test.js +1 -0
- package/dist/team/__tests__/tmux-test-fixture.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +54 -1
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/delivery-log.d.ts +1 -1
- package/dist/team/delivery-log.d.ts.map +1 -1
- package/dist/team/delivery-log.js.map +1 -1
- package/dist/team/repo-aware-decomposition.d.ts +4 -0
- package/dist/team/repo-aware-decomposition.d.ts.map +1 -1
- package/dist/team/repo-aware-decomposition.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +78 -9
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/tmux-session.d.ts +1 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +16 -5
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/ultragoal-context.d.ts +12 -0
- package/dist/team/ultragoal-context.d.ts.map +1 -1
- package/dist/team/ultragoal-context.js +32 -8
- package/dist/team/ultragoal-context.js.map +1 -1
- package/dist/utils/__tests__/paths.test.js +23 -0
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/__tests__/platform-command.test.js +16 -1
- package/dist/utils/__tests__/platform-command.test.js.map +1 -1
- package/dist/utils/__tests__/version.test.d.ts +2 -0
- package/dist/utils/__tests__/version.test.d.ts.map +1 -0
- package/dist/utils/__tests__/version.test.js +51 -0
- package/dist/utils/__tests__/version.test.js.map +1 -0
- package/dist/utils/paths.d.ts +8 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +20 -6
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/platform-command.d.ts +9 -0
- package/dist/utils/platform-command.d.ts.map +1 -1
- package/dist/utils/platform-command.js +15 -0
- package/dist/utils/platform-command.js.map +1 -1
- package/dist/utils/toml.d.ts +4 -0
- package/dist/utils/toml.d.ts.map +1 -0
- package/dist/utils/toml.js +75 -0
- package/dist/utils/toml.js.map +1 -0
- package/dist/utils/version.d.ts +7 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +67 -0
- package/dist/utils/version.js.map +1 -0
- package/dist/verification/__tests__/ci-rust-gates.test.js +8 -0
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js +16 -2
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js.map +1 -1
- package/package.json +4 -3
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +3 -0
- package/plugins/oh-my-codex/skills/code-review/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +85 -11
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +32 -17
- package/skills/autopilot/SKILL.md +3 -0
- package/skills/code-review/SKILL.md +2 -2
- package/skills/deep-interview/SKILL.md +85 -11
- package/skills/ultrawork/SKILL.md +32 -17
- package/src/scripts/__tests__/codex-native-hook.test.ts +391 -26
- package/src/scripts/__tests__/run-test-files.test.ts +138 -2
- package/src/scripts/codex-native-hook.ts +99 -17
- package/src/scripts/notify-hook/team-worker-stop.ts +58 -18
- package/src/scripts/prepare-build.js +83 -0
- package/src/scripts/run-test-files.ts +229 -150
- package/templates/AGENTS.md +40 -199
- package/src/scripts/postinstall-bootstrap.js +0 -23
package/dist/team/runtime.js
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, appendFileSync, mkdirSync } from 'fs';
|
|
|
3
3
|
import { mkdir, readdir, readFile, writeFile } from 'fs/promises';
|
|
4
4
|
import { performance } from 'perf_hooks';
|
|
5
5
|
import { spawn, spawnSync } from 'child_process';
|
|
6
|
-
import { sanitizeTeamName, isTmuxAvailable, hasCurrentTmuxClientContext, createTeamSession, buildWorkerProcessLaunchSpec, resolveTeamWorkerCli, resolveTeamWorkerCliPlan, resolveTeamWorkerLaunchMode, waitForWorkerReady, waitForWorkerReadyAsync, dismissTrustPromptIfPresent, evaluateStartupDirectTriggerSafety, sendToWorker, sendToWorkerStdin, isWorkerAlive, isWorkerPaneOpen, getWorkerPanePid, killWorkerByPaneIdAsync, restoreStandaloneHudPane, teardownWorkerPanes, unregisterResizeHook, destroyTeamSession, listPaneIds, listTeamSessions, resolveSharedSessionShutdownTopology, } from './tmux-session.js';
|
|
6
|
+
import { sanitizeTeamName, isTmuxAvailable, hasCurrentTmuxClientContext, createTeamSession, buildWorkerProcessLaunchSpec, scrubTeamWorkerHudOwnershipEnv, resolveTeamWorkerCli, resolveTeamWorkerCliPlan, resolveTeamWorkerLaunchMode, waitForWorkerReady, waitForWorkerReadyAsync, dismissTrustPromptIfPresent, evaluateStartupDirectTriggerSafety, sendToWorker, sendToWorkerStdin, isWorkerAlive, isWorkerPaneOpen, getWorkerPanePid, killWorkerByPaneIdAsync, restoreStandaloneHudPane, teardownWorkerPanes, unregisterResizeHook, destroyTeamSession, listPaneIds, listTeamSessions, resolveSharedSessionShutdownTopology, } from './tmux-session.js';
|
|
7
7
|
import { teamInit as initTeamState, DEFAULT_MAX_WORKERS, teamReadConfig as readTeamConfig, teamWriteWorkerIdentity as writeWorkerIdentity, teamReadWorkerHeartbeat as readWorkerHeartbeat, teamReadWorkerStatus as readWorkerStatus, teamWriteWorkerInbox as writeWorkerInbox, teamCreateTask as createStateTask, teamReadTask as readTask, teamListTasks as listTasks, teamUpdateTask as updateTask, teamReadManifest as readTeamManifestV2, teamNormalizeGovernance as normalizeTeamGovernance, teamNormalizePolicy as normalizeTeamPolicy, teamClaimTask as claimTask, teamReleaseTaskClaim as releaseTaskClaim, teamReclaimExpiredTaskClaim as reclaimExpiredTaskClaim, teamAppendEvent as appendTeamEvent, teamReadTaskApproval as readTaskApproval, teamListMailbox as listMailboxMessages, teamMarkMessageDelivered as markMessageDelivered, teamMarkMessageNotified as markMessageNotified, teamEnqueueDispatchRequest as enqueueDispatchRequest, teamMarkDispatchRequestNotified as markDispatchRequestNotified, teamTransitionDispatchRequest as transitionDispatchRequest, teamReadDispatchRequest as readDispatchRequest, teamCleanup as cleanupTeamState, teamSaveConfig as saveTeamConfig, teamWriteShutdownRequest as writeShutdownRequest, teamReadShutdownAck as readShutdownAck, teamReadMonitorSnapshot as readMonitorSnapshot, teamWriteMonitorSnapshot as writeMonitorSnapshot, teamReadPhase as readTeamPhaseState, teamWritePhase as writeTeamPhaseState, teamWriteWorkerStatus as writeWorkerStatus, writeAtomic, } from './team-ops.js';
|
|
8
8
|
import { queueInboxInstruction, queueDirectMailboxMessage, queueBroadcastMailboxMessage, waitForDispatchReceipt, } from './mcp-comm.js';
|
|
9
9
|
import { appendTeamDeliveryLogForCwd } from './delivery-log.js';
|
|
@@ -26,7 +26,7 @@ import { buildRebalanceDecisions } from './rebalance-policy.js';
|
|
|
26
26
|
import { getStatePath } from '../mcp/state-paths.js';
|
|
27
27
|
import { readModeState, updateModeState } from '../modes/base.js';
|
|
28
28
|
import { buildApprovedTeamHandoffSection, buildApprovedTeamExecutionBinding, normalizeApprovedTeamExecutionBinding, readApprovedTeamExecutionHintOutcomeFromBinding, resolvePersistedApprovedTeamExecutionContinuityState, writePersistedApprovedTeamExecutionBinding, } from './approved-execution.js';
|
|
29
|
-
import { readPersistedTeamUltragoalContext, renderLeaderOwnedUltragoalContextSection,
|
|
29
|
+
import { readPersistedTeamUltragoalContext, renderLeaderOwnedUltragoalContextSection, resolveLeaderOwnedUltragoalContextOutcome, writePersistedTeamUltragoalContext, } from './ultragoal-context.js';
|
|
30
30
|
import { appendTeamCommitHygieneEntries, buildTeamCommitHygieneContext, resolveTeamCommitHygieneArtifactCwd, writeTeamCommitHygieneContext, } from './commit-hygiene.js';
|
|
31
31
|
import { assertCleanLeaderWorkspaceForWorkerWorktrees, ensureWorktree, isGitRepository, isWorktreeDirty, planWorktreeTarget, removeWorktreeForce, rollbackProvisionedWorktrees, } from './worktree.js';
|
|
32
32
|
import { cleanupOmxMcpProcesses, findLaunchSafeCleanupCandidates, } from '../cli/cleanup.js';
|
|
@@ -958,6 +958,62 @@ function resolveEffectiveTeamWorktreeMode(leaderCwd, requestedMode) {
|
|
|
958
958
|
}
|
|
959
959
|
return { enabled: false };
|
|
960
960
|
}
|
|
961
|
+
function isExplicitUltragoalLinkedTeam(task, approvedExecution, selectedApprovedExecutionHint) {
|
|
962
|
+
const approvedHaystack = [
|
|
963
|
+
JSON.stringify(approvedExecution ?? {}),
|
|
964
|
+
JSON.stringify(selectedApprovedExecutionHint ?? {}),
|
|
965
|
+
].join('\n');
|
|
966
|
+
if (/(?:ultragoal|\.omx\/ultragoal)/i.test(approvedHaystack))
|
|
967
|
+
return true;
|
|
968
|
+
return /(?:\.omx\/ultragoal|ultragoal\s+(?:goal|plan|checkpoint)|goal\s+G\d{3}|\bG\d{3}[-\w]*\b)/i.test(task);
|
|
969
|
+
}
|
|
970
|
+
async function writeTeamPreflightContextPacket(params) {
|
|
971
|
+
const packetPath = join(params.teamStateRoot, 'team', params.teamName, 'preflight-context.json');
|
|
972
|
+
const packet = {
|
|
973
|
+
schema_version: 1,
|
|
974
|
+
created_at: new Date().toISOString(),
|
|
975
|
+
team_id: params.teamName,
|
|
976
|
+
display_name: params.displayName,
|
|
977
|
+
leader_cwd: params.leaderCwd,
|
|
978
|
+
task: params.task,
|
|
979
|
+
worker_count: params.workerCount,
|
|
980
|
+
worker_allocation: params.workerBootstrapPlans.map((plan) => ({
|
|
981
|
+
worker: plan.workerName,
|
|
982
|
+
role: plan.workerRole,
|
|
983
|
+
task_ids: plan.workerTasks.map((task) => task.id),
|
|
984
|
+
task_subjects: plan.workerTasks.map((task) => task.subject),
|
|
985
|
+
})),
|
|
986
|
+
approved_execution: params.approvedExecution
|
|
987
|
+
? {
|
|
988
|
+
prd_path: params.approvedExecution.prd_path,
|
|
989
|
+
task: params.approvedExecution.task,
|
|
990
|
+
}
|
|
991
|
+
: null,
|
|
992
|
+
ultragoal: {
|
|
993
|
+
status: params.ultragoalOutcome.status,
|
|
994
|
+
active_goal_id: params.ultragoalOutcome.context?.activeGoalId ?? null,
|
|
995
|
+
active_goal_title: params.ultragoalOutcome.context?.activeGoalTitle ?? null,
|
|
996
|
+
warning: params.ultragoalOutcome.warning?.message ?? null,
|
|
997
|
+
},
|
|
998
|
+
verification_checklist: [
|
|
999
|
+
'collect worker evidence before leader checkpoint',
|
|
1000
|
+
'run targeted verification for changed files',
|
|
1001
|
+
'leader performs any Ultragoal checkpoint from fresh get_goal evidence',
|
|
1002
|
+
],
|
|
1003
|
+
prohibitions: [
|
|
1004
|
+
'workers_must_not_mutate_ultragoal',
|
|
1005
|
+
'workers_must_not_checkpoint_ultragoal',
|
|
1006
|
+
],
|
|
1007
|
+
resume_instructions: [
|
|
1008
|
+
`After compaction, reload ${packetPath}`,
|
|
1009
|
+
'Verify the active Ultragoal goal still matches this packet before checkpointing.',
|
|
1010
|
+
'Resume Team monitoring with omx team status before dispatching follow-up work.',
|
|
1011
|
+
],
|
|
1012
|
+
};
|
|
1013
|
+
await mkdir(dirname(packetPath), { recursive: true });
|
|
1014
|
+
await writeFile(packetPath, `${JSON.stringify(packet, null, 2)}\n`, 'utf-8');
|
|
1015
|
+
return packetPath;
|
|
1016
|
+
}
|
|
961
1017
|
const MODEL_INSTRUCTIONS_FILE_ENV = 'OMX_MODEL_INSTRUCTIONS_FILE';
|
|
962
1018
|
const TEAM_STATE_ROOT_ENV = 'OMX_TEAM_STATE_ROOT';
|
|
963
1019
|
const TEAM_LEADER_CWD_ENV = 'OMX_TEAM_LEADER_CWD';
|
|
@@ -1547,7 +1603,7 @@ export { TEAM_LOW_COMPLEXITY_DEFAULT_MODEL };
|
|
|
1547
1603
|
export { resolveCanonicalTeamStateRoot };
|
|
1548
1604
|
function spawnPromptWorker(teamName, workerName, workerIndex, workerCwd, launchArgs, workerEnv, workerCli, initialPrompt, workerRole) {
|
|
1549
1605
|
const processSpec = buildWorkerProcessLaunchSpec(teamName, workerIndex, launchArgs, workerCwd, workerEnv, workerCli, initialPrompt, workerRole);
|
|
1550
|
-
const childEnv = { ...process.env, ...processSpec.env };
|
|
1606
|
+
const childEnv = scrubTeamWorkerHudOwnershipEnv({ ...process.env, ...processSpec.env });
|
|
1551
1607
|
// Prompt workers are external CLI processes, not in-process runtime code.
|
|
1552
1608
|
// Keeping c8's NODE_V8_COVERAGE in their environment makes coverage runs
|
|
1553
1609
|
// track long-lived fake worker descendants and can keep node --test alive
|
|
@@ -1706,7 +1762,12 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
|
|
|
1706
1762
|
const approvedExecution = selectedApprovedExecutionHint
|
|
1707
1763
|
? buildApprovedTeamExecutionBinding(selectedApprovedExecutionHint)
|
|
1708
1764
|
: null;
|
|
1709
|
-
const
|
|
1765
|
+
const explicitUltragoalLinkedTeam = isExplicitUltragoalLinkedTeam(task, requestedApprovedExecution ?? approvedExecution, selectedApprovedExecutionHint);
|
|
1766
|
+
const ultragoalOutcome = await resolveLeaderOwnedUltragoalContextOutcome(leaderCwd);
|
|
1767
|
+
if (explicitUltragoalLinkedTeam && ultragoalOutcome.status !== 'valid') {
|
|
1768
|
+
throw new Error(`invalid_ultragoal_team_context:${ultragoalOutcome.warning?.message ?? ultragoalOutcome.status}`);
|
|
1769
|
+
}
|
|
1770
|
+
const ultragoalContext = ultragoalOutcome.status === 'valid' ? ultragoalOutcome.context : null;
|
|
1710
1771
|
const approvedContextSection = joinContextSections(buildApprovedTeamHandoffSection(selectedApprovedExecutionHint), renderLeaderOwnedUltragoalContextSection(ultragoalContext));
|
|
1711
1772
|
const activeWorktreeMode = effectiveWorktreeMode.enabled
|
|
1712
1773
|
? (effectiveWorktreeMode.detached ? 'detached' : 'named')
|
|
@@ -1993,6 +2054,17 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
|
|
|
1993
2054
|
await writeWorkerInbox(sanitized, bootstrapPlan.workerName, bootstrapPlan.inbox, leaderCwd);
|
|
1994
2055
|
};
|
|
1995
2056
|
// 6. Create worker runtime (interactive tmux panes or prompt-mode child processes)
|
|
2057
|
+
await writeTeamPreflightContextPacket({
|
|
2058
|
+
teamName: sanitized,
|
|
2059
|
+
displayName,
|
|
2060
|
+
teamStateRoot,
|
|
2061
|
+
leaderCwd,
|
|
2062
|
+
task,
|
|
2063
|
+
workerCount,
|
|
2064
|
+
workerBootstrapPlans,
|
|
2065
|
+
approvedExecution,
|
|
2066
|
+
ultragoalOutcome,
|
|
2067
|
+
});
|
|
1996
2068
|
await cleanupTeamWorkerLaunchOrphanedMcpProcesses({
|
|
1997
2069
|
cleanup: options.cleanupLaunchOrphanedMcpProcesses,
|
|
1998
2070
|
writeWarning: options.writeCleanupWarning,
|
|
@@ -2730,11 +2802,8 @@ export async function shutdownTeam(teamName, cwd, options = {}) {
|
|
|
2730
2802
|
worker: 'leader-fixed',
|
|
2731
2803
|
reason: 'force_bypass',
|
|
2732
2804
|
}, cwd).catch(() => { });
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
// Prompt-mode workers are raw CLI children, not team-runtime workers that
|
|
2736
|
-
// participate in the shutdown-ack handshake. Waiting the full ack window
|
|
2737
|
-
// before force-killing them only adds deterministic suite slowness.
|
|
2805
|
+
// Explicit force means teardown now. Do not spend the graceful ack window
|
|
2806
|
+
// waiting for interactive panes or prompt workers that will be killed below.
|
|
2738
2807
|
skipWorkerAcks = true;
|
|
2739
2808
|
}
|
|
2740
2809
|
const sessionName = config.tmux_session;
|