@loucompanion/forge-bridge 0.1.4-dev.a690038a6849 → 0.1.4-dev.b1c678efffd2
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/README.md +44 -2
- package/dist/bridge/bridge-chat-provider-command.d.ts +16 -0
- package/dist/bridge/bridge-chat-provider-command.js +125 -0
- package/dist/bridge/bridge.base.d.ts +9 -0
- package/dist/bridge/bridge.service.d.ts +73 -2
- package/dist/bridge/bridge.service.js +312 -119
- package/dist/bridge/bridge.types.d.ts +16 -0
- package/dist/bridge/local-yield-flag.d.ts +6 -0
- package/dist/bridge/local-yield-flag.js +34 -0
- package/dist/bridge/runner-host-capabilities.d.ts +2 -0
- package/dist/bridge/runner-host-capabilities.js +4 -0
- package/dist/bridge/test-postgres-capability.d.ts +14 -0
- package/dist/bridge/test-postgres-capability.js +120 -0
- package/dist/cleanup/cleanup.service.d.ts +9 -0
- package/dist/cleanup/cleanup.service.js +72 -109
- package/dist/cleanup/cleanup.types.d.ts +4 -0
- package/dist/cleanup/forge-owned-paths.d.ts +9 -0
- package/dist/cleanup/forge-owned-paths.js +53 -0
- package/dist/cleanup/host-runtime-ledger.d.ts +5 -0
- package/dist/cleanup/host-runtime-ledger.js +109 -0
- package/dist/cleanup/managed-branch-sweep.d.ts +27 -0
- package/dist/cleanup/managed-branch-sweep.js +111 -0
- package/dist/cli/cli.help.js +18 -0
- package/dist/cli/cli.service.d.ts +16 -0
- package/dist/cli/cli.service.js +142 -16
- package/dist/cli/local-config.d.ts +4 -0
- package/dist/cli/local-config.js +26 -4
- package/dist/runtime/aspnet-runtime-prebuild.js +94 -6
- package/dist/runtime/host-load-admission.d.ts +60 -0
- package/dist/runtime/host-load-admission.js +99 -0
- package/dist/runtime/host-load-child-environment.d.ts +22 -0
- package/dist/runtime/host-load-child-environment.js +67 -0
- package/dist/runtime/host-load-forge-cgroups.d.ts +49 -0
- package/dist/runtime/host-load-forge-cgroups.js +140 -0
- package/dist/runtime/host-load-governor-config.d.ts +43 -0
- package/dist/runtime/host-load-governor-config.js +76 -0
- package/dist/runtime/host-load-governor.d.ts +174 -0
- package/dist/runtime/host-load-governor.js +541 -0
- package/dist/runtime/host-load-ledger-lock.d.ts +69 -0
- package/dist/runtime/host-load-ledger-lock.js +185 -0
- package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
- package/dist/runtime/host-load-runtime-settings.js +78 -0
- package/dist/runtime/host-load-sampler.d.ts +43 -0
- package/dist/runtime/host-load-sampler.js +74 -6
- package/dist/runtime/host-load-step-class.d.ts +68 -0
- package/dist/runtime/host-load-step-class.js +106 -0
- package/dist/runtime/host-load-step-reaper.d.ts +27 -0
- package/dist/runtime/host-load-step-reaper.js +95 -0
- package/dist/runtime/host-load-step-run.d.ts +73 -0
- package/dist/runtime/host-load-step-run.js +102 -0
- package/dist/runtime/host-load-token-ledger.d.ts +174 -0
- package/dist/runtime/host-load-token-ledger.js +421 -0
- package/dist/runtime/host-pressure-stall.d.ts +21 -1
- package/dist/runtime/host-pressure-stall.js +48 -1
- package/dist/runtime/host-runtime-contract.d.ts +3 -0
- package/dist/runtime/host-runtime-contract.js +4 -1
- package/dist/runtime/host-runtime-lease.d.ts +74 -4
- package/dist/runtime/host-runtime-lease.js +281 -11
- package/dist/runtime/host-runtime-promotion.d.ts +23 -0
- package/dist/runtime/host-runtime-promotion.js +48 -0
- package/dist/runtime/host-runtime-requirements-check.d.ts +17 -0
- package/dist/runtime/host-runtime-requirements-check.js +29 -0
- package/dist/runtime/host-runtime-requirements.d.ts +36 -0
- package/dist/runtime/host-runtime-requirements.js +117 -0
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +7 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +13 -1
- package/dist/runtime/runner-settings.d.ts +100 -0
- package/dist/runtime/runner-settings.js +214 -0
- package/dist/sandbox/host-capacity-broker.d.ts +107 -0
- package/dist/sandbox/host-capacity-broker.js +315 -0
- package/dist/sandbox/runtime.d.ts +10 -1
- package/dist/sandbox/runtime.js +45 -2
- package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
- package/dist/sandbox/sandbox-cgroups.js +42 -0
- package/dist/session/managed-attempt-tools.d.ts +2 -0
- package/dist/session/managed-attempt-tools.js +156 -37
- package/dist/session/managed-command-host-load.d.ts +45 -0
- package/dist/session/managed-command-host-load.js +82 -0
- package/dist/session/mcp-argument-coercion.d.ts +23 -0
- package/dist/session/mcp-argument-coercion.js +121 -0
- package/dist/session/phase-completion.artifacts.d.ts +7 -0
- package/dist/session/phase-completion.artifacts.js +94 -25
- package/dist/session/phase-completion.command-validation.d.ts +7 -0
- package/dist/session/phase-completion.command-validation.js +77 -0
- package/dist/session/phase-completion.d.ts +4 -0
- package/dist/session/phase-completion.helpers.js +13 -12
- package/dist/session/phase-completion.js +4 -0
- package/dist/session/phase-completion.prompts.js +6 -1
- package/dist/session/phase-completion.runtime.d.ts +5 -3
- package/dist/session/phase-completion.runtime.js +49 -19
- package/dist/session/phase-completion.schema-parts.d.ts +19 -0
- package/dist/session/phase-completion.schema-parts.js +188 -0
- package/dist/session/phase-completion.schemas.d.ts +3 -3
- package/dist/session/phase-completion.schemas.js +206 -221
- package/dist/session/phase-completion.validation.d.ts +2 -3
- package/dist/session/phase-completion.validation.js +46 -92
- package/dist/session/pre-publication-host-load.d.ts +27 -0
- package/dist/session/pre-publication-host-load.js +111 -0
- package/dist/session/pre-publication-pass.d.ts +60 -0
- package/dist/session/pre-publication-pass.js +145 -0
- package/dist/session/pre-publication-process.d.ts +3 -0
- package/dist/session/pre-publication-process.js +23 -11
- package/dist/session/pre-publication-step-execution.d.ts +11 -0
- package/dist/session/pre-publication-step-execution.js +49 -0
- package/dist/session/pre-publication-validation.d.ts +30 -20
- package/dist/session/pre-publication-validation.js +166 -155
- package/dist/session/provider-cli/claude-background-work.d.ts +66 -0
- package/dist/session/provider-cli/claude-background-work.js +180 -0
- package/dist/session/provider-cli/pre-publication-repair.d.ts +40 -0
- package/dist/session/provider-cli/pre-publication-repair.js +243 -0
- package/dist/session/provider-cli/provider-cli.artifacts.js +15 -3
- package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +89 -0
- package/dist/session/provider-cli/provider-cli.merge-integrity.js +310 -0
- package/dist/session/provider-cli/provider-cli.process.d.ts +14 -6
- package/dist/session/provider-cli/provider-cli.process.js +29 -61
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +2 -0
- package/dist/session/provider-cli/provider-cli.prompts.js +52 -10
- package/dist/session/provider-cli/provider-cli.runtime.js +7 -0
- package/dist/session/provider-cli/provider-cli.service.d.ts +4 -1
- package/dist/session/provider-cli/provider-cli.service.js +107 -153
- package/dist/session/provider-cli/provider-cli.types.d.ts +30 -0
- package/dist/session/provider-cli/provider-in-flight-work.d.ts +4 -0
- package/dist/session/provider-cli/provider-in-flight-work.js +45 -0
- package/dist/session/provider-cli/provider-output-state.d.ts +2 -0
- package/dist/session/provider-cli/provider-output-state.js +6 -0
- package/dist/session/publishable-worktree-changes.d.ts +10 -1
- package/dist/session/publishable-worktree-changes.js +21 -5
- package/dist/session/sandbox-host-capacity-gate.d.ts +30 -0
- package/dist/session/sandbox-host-capacity-gate.js +229 -0
- package/dist/session/session.base.d.ts +9 -1
- package/dist/session/session.service.d.ts +9 -2
- package/dist/session/session.service.js +120 -5
- package/dist/session/session.types.d.ts +3 -0
- package/dist/session/session.types.js +7 -4
- package/dist/session/workspace-runtime-fingerprint.d.ts +32 -0
- package/dist/session/workspace-runtime-fingerprint.js +138 -0
- package/dist/shared/process/host-process-supervisor.d.ts +1 -0
- package/dist/shared/process/host-process-supervisor.js +1 -1
- package/dist/shared/process/process-tree.d.ts +52 -0
- package/dist/shared/process/process-tree.js +144 -0
- package/dist/shared/process/process.d.ts +67 -0
- package/dist/shared/process/process.js +213 -11
- package/dist/shared/provider-capabilities.js +5 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/dependency-warmer.d.ts +25 -0
- package/dist/worktree/dependency-warmer.js +46 -10
- package/dist/worktree/worktree.service.d.ts +10 -1
- package/dist/worktree/worktree.service.js +42 -2
- package/dist/worktree/worktree.types.d.ts +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { ForgeFailureError } from "../session.types.js";
|
|
4
|
+
const maxListedPaths = 20;
|
|
5
|
+
const pathArgumentChunkSize = 100;
|
|
6
|
+
const objectIdPattern = /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/iu;
|
|
7
|
+
/**
|
|
8
|
+
* The publication would re-add files that the target branch deleted, or revert
|
|
9
|
+
* target-branch edits, on paths the story never changed. Forge refuses to commit
|
|
10
|
+
* or push such a merge.
|
|
11
|
+
*/
|
|
12
|
+
export class MergeResolutionRevertsUpstreamChangesError extends ForgeFailureError {
|
|
13
|
+
merge;
|
|
14
|
+
resurrectedPaths;
|
|
15
|
+
revertedPaths;
|
|
16
|
+
code = "merge_resolution_reverts_upstream_changes";
|
|
17
|
+
constructor(merge, resurrectedPaths, revertedPaths) {
|
|
18
|
+
super("merge_resolution_reverts_upstream_changes", describeRevertedUpstreamChanges(merge, resurrectedPaths, revertedPaths), "bridge");
|
|
19
|
+
this.merge = merge;
|
|
20
|
+
this.resurrectedPaths = resurrectedPaths;
|
|
21
|
+
this.revertedPaths = revertedPaths;
|
|
22
|
+
this.name = "MergeResolutionRevertsUpstreamChangesError";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A conflict is still unresolved when Forge would stage the merge: a
|
|
27
|
+
* modify/delete conflict nobody decided (`git add -A` would silently keep the
|
|
28
|
+
* modified side), or a content conflict whose file still has conflict markers
|
|
29
|
+
* (`git add -A` would commit them).
|
|
30
|
+
*/
|
|
31
|
+
export class MergeResolutionUnresolvedConflictError extends ForgeFailureError {
|
|
32
|
+
conflicts;
|
|
33
|
+
code = "merge_resolution_unresolved_conflict";
|
|
34
|
+
constructor(conflicts) {
|
|
35
|
+
super("merge_resolution_unresolved_conflict", `merge_resolution_unresolved_conflict: ${conflicts.length} merge conflict(s) were left unresolved: ${listPaths(conflicts.map(conflict => `${conflict.path} (${conflict.kind.replaceAll("_", " ")})`))}. Resolve content conflicts by removing every conflict marker, and resolve each modify/delete or binary conflict explicitly with \`git rm <path>\` to accept the deletion or \`git add <path>\` to stage the chosen file; Forge did not commit or push the merge.`, "bridge");
|
|
36
|
+
this.conflicts = conflicts;
|
|
37
|
+
this.name = "MergeResolutionUnresolvedConflictError";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** True while MERGE_HEAD exists, whether or not the histories share a merge base. */
|
|
41
|
+
export async function isMergeInProgress(git, worktreePath) {
|
|
42
|
+
return await tryRevParse(git, worktreePath, "MERGE_HEAD") !== null;
|
|
43
|
+
}
|
|
44
|
+
export async function readInProgressMerge(git, worktreePath) {
|
|
45
|
+
const mergeHeadSha = await tryRevParse(git, worktreePath, "MERGE_HEAD");
|
|
46
|
+
if (!mergeHeadSha)
|
|
47
|
+
return null;
|
|
48
|
+
const headSha = await tryRevParse(git, worktreePath, "HEAD");
|
|
49
|
+
if (!headSha)
|
|
50
|
+
return null;
|
|
51
|
+
let mergeBaseSha;
|
|
52
|
+
try {
|
|
53
|
+
mergeBaseSha = (await git.run(worktreePath, ["merge-base", headSha, mergeHeadSha])).trim();
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Unrelated histories have no merge base, so there is no upstream deletion to protect.
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
if (!objectIdPattern.test(mergeBaseSha))
|
|
60
|
+
return null;
|
|
61
|
+
return { headSha, mergeHeadSha, mergeBaseSha };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Fails before `git add -A` can silently resolve a conflict:
|
|
65
|
+
* - a modify/delete conflict, by keeping whatever is on disk;
|
|
66
|
+
* - a binary (or other marker-less) conflict, by staging whichever side is on disk;
|
|
67
|
+
* - a content conflict, by staging its conflict markers. This includes markers
|
|
68
|
+
* the provider already staged, which clears the unmerged stages, so every path
|
|
69
|
+
* both sides changed is checked too.
|
|
70
|
+
* A text conflict the agent resolved in the working tree without `git add` is
|
|
71
|
+
* still unmerged here and is accepted once its markers are gone.
|
|
72
|
+
*/
|
|
73
|
+
export async function assertNoUnresolvedMergeConflicts(git, worktreePath) {
|
|
74
|
+
const merge = await readInProgressMerge(git, worktreePath);
|
|
75
|
+
if (!merge)
|
|
76
|
+
return;
|
|
77
|
+
const conflicts = await readUnresolvedMergeConflicts(git, worktreePath, merge);
|
|
78
|
+
if (conflicts.length > 0) {
|
|
79
|
+
throw new MergeResolutionUnresolvedConflictError(conflicts);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export async function readUnresolvedMergeConflicts(git, worktreePath, merge) {
|
|
83
|
+
const stagesByPath = new Map();
|
|
84
|
+
for (const record of splitNul(await git.run(worktreePath, ["ls-files", "--unmerged", "-z"]))) {
|
|
85
|
+
const tab = record.indexOf("\t");
|
|
86
|
+
if (tab < 0)
|
|
87
|
+
continue;
|
|
88
|
+
const stage = record.slice(0, tab).trim().split(/\s+/u).at(-1) ?? "";
|
|
89
|
+
const filePath = record.slice(tab + 1);
|
|
90
|
+
const stages = stagesByPath.get(filePath) ?? new Set();
|
|
91
|
+
stages.add(stage);
|
|
92
|
+
stagesByPath.set(filePath, stages);
|
|
93
|
+
}
|
|
94
|
+
const conflicts = [];
|
|
95
|
+
const contentConflicts = [];
|
|
96
|
+
for (const [filePath, stages] of stagesByPath) {
|
|
97
|
+
const ours = stages.has("2");
|
|
98
|
+
const theirs = stages.has("3");
|
|
99
|
+
if (stages.has("1") && ours && !theirs)
|
|
100
|
+
conflicts.push({ path: filePath, kind: "deleted_by_upstream" });
|
|
101
|
+
else if (stages.has("1") && theirs && !ours)
|
|
102
|
+
conflicts.push({ path: filePath, kind: "deleted_by_story" });
|
|
103
|
+
else
|
|
104
|
+
contentConflicts.push(filePath);
|
|
105
|
+
}
|
|
106
|
+
const binaryByAttributes = await readBinaryByAttributes(git, worktreePath, contentConflicts);
|
|
107
|
+
for (const filePath of contentConflicts) {
|
|
108
|
+
const content = await readWorkingFile(worktreePath, filePath);
|
|
109
|
+
// `git add -A` would stage a missing file as a deletion and clear the conflict
|
|
110
|
+
// stages; only an explicit `git rm` or `git add` resolves it.
|
|
111
|
+
if (!content)
|
|
112
|
+
conflicts.push({ path: filePath, kind: "missing_while_unmerged" });
|
|
113
|
+
// Git writes no markers into a binary conflict (by content, or via `-merge` /
|
|
114
|
+
// `merge=binary`, as the `binary` macro sets), so only an explicit `git add` resolves it.
|
|
115
|
+
else if (binaryByAttributes.has(filePath) || isBinary(content))
|
|
116
|
+
conflicts.push({ path: filePath, kind: "unresolved_binary" });
|
|
117
|
+
else if (hasConflictMarkers(content))
|
|
118
|
+
conflicts.push({ path: filePath, kind: "conflict_markers" });
|
|
119
|
+
}
|
|
120
|
+
const storyChanged = new Set(await diffNames(git, worktreePath, [merge.mergeBaseSha, merge.headSha]));
|
|
121
|
+
const bothChanged = (await diffNames(git, worktreePath, [merge.mergeBaseSha, merge.mergeHeadSha]))
|
|
122
|
+
.filter(filePath => storyChanged.has(filePath) && !stagesByPath.has(filePath));
|
|
123
|
+
for (const filePath of bothChanged) {
|
|
124
|
+
const content = await readWorkingFile(worktreePath, filePath);
|
|
125
|
+
if (content && !isBinary(content) && hasConflictMarkers(content)) {
|
|
126
|
+
conflicts.push({ path: filePath, kind: "conflict_markers" });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return conflicts.sort((left, right) => left.path.localeCompare(right.path));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Staging excludes some worktree changes (Forge runtime output) by unstaging them
|
|
133
|
+
* back to HEAD. During a merge HEAD is the story side, so an excluded path the merge
|
|
134
|
+
* itself changed would lose the target's change. Given the excluded candidate
|
|
135
|
+
* paths, put the merge-owned ones back into the index: the target branch's version
|
|
136
|
+
* where the story never touched the path, and the agent's working-tree resolution
|
|
137
|
+
* where both sides changed it. Returns the restored paths; the rest stay excluded.
|
|
138
|
+
*/
|
|
139
|
+
export async function restoreMergeOwnedPaths(git, worktreePath, candidatePaths) {
|
|
140
|
+
if (candidatePaths.length === 0)
|
|
141
|
+
return [];
|
|
142
|
+
const merge = await readInProgressMerge(git, worktreePath);
|
|
143
|
+
if (!merge)
|
|
144
|
+
return [];
|
|
145
|
+
const candidates = new Set(candidatePaths);
|
|
146
|
+
const upstreamChanged = (await diffNames(git, worktreePath, [merge.mergeBaseSha, merge.mergeHeadSha]))
|
|
147
|
+
.filter(filePath => candidates.has(filePath));
|
|
148
|
+
if (upstreamChanged.length === 0)
|
|
149
|
+
return [];
|
|
150
|
+
const storyChanged = new Set(await diffNames(git, worktreePath, [merge.mergeBaseSha, merge.headSha]));
|
|
151
|
+
const upstreamOnly = upstreamChanged.filter(filePath => !storyChanged.has(filePath));
|
|
152
|
+
const bothChanged = upstreamChanged.filter(filePath => storyChanged.has(filePath));
|
|
153
|
+
for (const chunk of chunks(upstreamOnly)) {
|
|
154
|
+
// Resetting from MERGE_HEAD also removes index entries the target branch deleted.
|
|
155
|
+
await git.run(worktreePath, ["--literal-pathspecs", "reset", "-q", merge.mergeHeadSha, "--", ...chunk]);
|
|
156
|
+
}
|
|
157
|
+
const indexed = new Set();
|
|
158
|
+
for (const chunk of chunks(bothChanged)) {
|
|
159
|
+
for (const filePath of splitNul(await git.run(worktreePath, ["--literal-pathspecs", "ls-files", "-z", "--", ...chunk]))) {
|
|
160
|
+
indexed.add(filePath);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const stageable = [];
|
|
164
|
+
for (const filePath of bothChanged) {
|
|
165
|
+
if (indexed.has(filePath) || await existsOnDisk(worktreePath, filePath))
|
|
166
|
+
stageable.push(filePath);
|
|
167
|
+
}
|
|
168
|
+
for (const chunk of chunks(stageable)) {
|
|
169
|
+
await git.run(worktreePath, ["--literal-pathspecs", "add", "-A", "--", ...chunk]);
|
|
170
|
+
}
|
|
171
|
+
return [...upstreamOnly, ...stageable].sort();
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Final check on the index Forge is about to commit. Throws when the merge
|
|
175
|
+
* resolution re-adds a path the target branch deleted, or drops a target-branch
|
|
176
|
+
* edit, on a path the story never changed.
|
|
177
|
+
*/
|
|
178
|
+
export async function assertMergeResolutionPreservesUpstreamChanges(git, worktreePath, options = {}) {
|
|
179
|
+
const merge = await readInProgressMerge(git, worktreePath);
|
|
180
|
+
if (!merge)
|
|
181
|
+
return { keptOverUpstreamDeletion: [] };
|
|
182
|
+
const upstream = await diffNameStatus(git, worktreePath, [merge.mergeBaseSha, merge.mergeHeadSha]);
|
|
183
|
+
if (upstream.size === 0)
|
|
184
|
+
return { keptOverUpstreamDeletion: [] };
|
|
185
|
+
const storyChanged = new Set(await diffNames(git, worktreePath, [merge.mergeBaseSha, merge.headSha]));
|
|
186
|
+
// Index compared with the merge base: a path absent here is identical to the base.
|
|
187
|
+
const indexVersusBase = await diffNameStatus(git, worktreePath, ["--cached", merge.mergeBaseSha]);
|
|
188
|
+
const resurrectedPaths = [];
|
|
189
|
+
const revertedPaths = [];
|
|
190
|
+
const keptOverUpstreamDeletion = [];
|
|
191
|
+
for (const [filePath, status] of upstream) {
|
|
192
|
+
// Runtime-only paths are never published, so the story's version stays by design.
|
|
193
|
+
if (options.ignorePath?.(filePath))
|
|
194
|
+
continue;
|
|
195
|
+
const indexStatus = indexVersusBase.get(filePath);
|
|
196
|
+
if (status === "D") {
|
|
197
|
+
const presentInIndex = indexStatus !== "D";
|
|
198
|
+
if (!presentInIndex)
|
|
199
|
+
continue;
|
|
200
|
+
if (storyChanged.has(filePath))
|
|
201
|
+
keptOverUpstreamDeletion.push(filePath);
|
|
202
|
+
else
|
|
203
|
+
resurrectedPaths.push(filePath);
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
// Equal to the base (undefined) or deleted: the target's edit is discarded. Other
|
|
207
|
+
// index content is a post-merge fixup on top of the target's version and is allowed.
|
|
208
|
+
if (!storyChanged.has(filePath) && (indexStatus === undefined || indexStatus === "D")) {
|
|
209
|
+
revertedPaths.push(filePath);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (resurrectedPaths.length > 0 || revertedPaths.length > 0) {
|
|
213
|
+
throw new MergeResolutionRevertsUpstreamChangesError(merge, resurrectedPaths.sort(), revertedPaths.sort());
|
|
214
|
+
}
|
|
215
|
+
return { keptOverUpstreamDeletion: keptOverUpstreamDeletion.sort() };
|
|
216
|
+
}
|
|
217
|
+
export function mergeResolutionCommitNotes(report) {
|
|
218
|
+
if (report.keptOverUpstreamDeletion.length === 0)
|
|
219
|
+
return [];
|
|
220
|
+
return [
|
|
221
|
+
`Kept ${report.keptOverUpstreamDeletion.length} story-modified path(s) that the target branch deleted (modify/delete conflicts resolved by the agent):\n${report.keptOverUpstreamDeletion.map(filePath => `- ${filePath}`).join("\n")}`,
|
|
222
|
+
];
|
|
223
|
+
}
|
|
224
|
+
function describeRevertedUpstreamChanges(merge, resurrectedPaths, revertedPaths) {
|
|
225
|
+
const parts = [];
|
|
226
|
+
if (resurrectedPaths.length > 0) {
|
|
227
|
+
parts.push(`re-adds ${resurrectedPaths.length} path(s) that ${merge.mergeHeadSha.slice(0, 12)} deleted and the story never changed: ${listPaths(resurrectedPaths)}`);
|
|
228
|
+
}
|
|
229
|
+
if (revertedPaths.length > 0) {
|
|
230
|
+
parts.push(`reverts or deletes ${revertedPaths.length} upstream edit(s) on path(s) the story never changed: ${listPaths(revertedPaths)}`);
|
|
231
|
+
}
|
|
232
|
+
return `merge_resolution_reverts_upstream_changes: the merge resolution ${parts.join("; and ")} (merge base ${merge.mergeBaseSha.slice(0, 12)}). Forge did not commit or push the merge.`;
|
|
233
|
+
}
|
|
234
|
+
function listPaths(paths) {
|
|
235
|
+
const listed = paths.slice(0, maxListedPaths).join(", ");
|
|
236
|
+
return paths.length > maxListedPaths ? `${listed}, and ${paths.length - maxListedPaths} more` : listed;
|
|
237
|
+
}
|
|
238
|
+
async function tryRevParse(git, worktreePath, ref) {
|
|
239
|
+
try {
|
|
240
|
+
const sha = (await git.run(worktreePath, ["rev-parse", "-q", "--verify", `${ref}^{commit}`])).trim();
|
|
241
|
+
return objectIdPattern.test(sha) ? sha : null;
|
|
242
|
+
}
|
|
243
|
+
catch {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function diffNames(git, worktreePath, args) {
|
|
248
|
+
return splitNul(await git.run(worktreePath, ["diff", "--no-renames", "--name-only", "-z", ...args]));
|
|
249
|
+
}
|
|
250
|
+
async function diffNameStatus(git, worktreePath, args) {
|
|
251
|
+
const fields = splitNul(await git.run(worktreePath, ["diff", "--no-renames", "--name-status", "-z", ...args]));
|
|
252
|
+
const statuses = new Map();
|
|
253
|
+
for (let index = 0; index + 1 < fields.length; index += 2) {
|
|
254
|
+
statuses.set(fields[index + 1], fields[index].charAt(0));
|
|
255
|
+
}
|
|
256
|
+
return statuses;
|
|
257
|
+
}
|
|
258
|
+
function splitNul(output) {
|
|
259
|
+
return output.split("\0").filter(entry => entry.length > 0);
|
|
260
|
+
}
|
|
261
|
+
function chunks(paths) {
|
|
262
|
+
const result = [];
|
|
263
|
+
for (let index = 0; index < paths.length; index += pathArgumentChunkSize) {
|
|
264
|
+
result.push(paths.slice(index, index + pathArgumentChunkSize));
|
|
265
|
+
}
|
|
266
|
+
return result;
|
|
267
|
+
}
|
|
268
|
+
const conflictMarkerPattern = /^<{7}(?: |$)[\s\S]*^>{7}(?: |$)/mu;
|
|
269
|
+
function hasConflictMarkers(content) {
|
|
270
|
+
return conflictMarkerPattern.test(content.toString("utf8"));
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Paths whose effective `merge` attribute selects Git's binary merge driver, which
|
|
274
|
+
* writes no conflict markers: `merge` unset (`-merge`, part of the `binary` macro) or
|
|
275
|
+
* `merge=binary`. `-text` and `-diff` do not change how Git merges, so they are ignored.
|
|
276
|
+
*/
|
|
277
|
+
async function readBinaryByAttributes(git, worktreePath, filePaths) {
|
|
278
|
+
const binary = new Set();
|
|
279
|
+
for (const chunk of chunks(filePaths)) {
|
|
280
|
+
const fields = splitNul(await git.run(worktreePath, ["check-attr", "-z", "merge", "--", ...chunk]));
|
|
281
|
+
for (let index = 0; index + 2 < fields.length; index += 3) {
|
|
282
|
+
const [filePath, value] = [fields[index], fields[index + 2]];
|
|
283
|
+
if (value === "unset" || value === "binary")
|
|
284
|
+
binary.add(filePath);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return binary;
|
|
288
|
+
}
|
|
289
|
+
function isBinary(content) {
|
|
290
|
+
// Git's own heuristic: a NUL byte in the first 8000 bytes.
|
|
291
|
+
return content.subarray(0, 8000).includes(0);
|
|
292
|
+
}
|
|
293
|
+
async function readWorkingFile(worktreePath, filePath) {
|
|
294
|
+
try {
|
|
295
|
+
return await fs.readFile(path.join(worktreePath, ...filePath.split("/")));
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
// Missing on disk: `git add -A` stages a deletion, which the upstream-change guard checks.
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
async function existsOnDisk(worktreePath, filePath) {
|
|
303
|
+
try {
|
|
304
|
+
await fs.lstat(path.join(worktreePath, ...filePath.split("/")));
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
@@ -22,8 +22,8 @@ export interface ProviderProcessRunRequest {
|
|
|
22
22
|
*/
|
|
23
23
|
readonly resumesProviderThread?: boolean;
|
|
24
24
|
}
|
|
25
|
-
/** Why Forge stopped a provider
|
|
26
|
-
export type ProviderTerminalStopReason = "turn_exit_grace" | "success_ceiling";
|
|
25
|
+
/** Why Forge stopped a provider still resident after its turn (or its background work, for Claude). */
|
|
26
|
+
export type ProviderTerminalStopReason = "turn_exit_grace" | "success_ceiling" | "turn_ended_with_background_work";
|
|
27
27
|
export interface ProviderProcessRunResult {
|
|
28
28
|
readonly exitCode: number;
|
|
29
29
|
readonly stdout: string;
|
|
@@ -34,7 +34,7 @@ export interface ProviderProcessRunResult {
|
|
|
34
34
|
readonly memoryObservedAt?: string;
|
|
35
35
|
/** Present when the caller's cancellation stopped the process before it exited on its own. */
|
|
36
36
|
readonly cancelled?: true;
|
|
37
|
-
/** Present when Forge stopped a provider that stayed resident after
|
|
37
|
+
/** Present when Forge stopped a provider that stayed resident after its turn ended. */
|
|
38
38
|
readonly terminalStopReason?: ProviderTerminalStopReason;
|
|
39
39
|
}
|
|
40
40
|
export interface ProviderProcessRunner {
|
|
@@ -50,9 +50,17 @@ export interface ProviderProcessHandlers {
|
|
|
50
50
|
* end-of-turn exit grace and the success ceiling.
|
|
51
51
|
*/
|
|
52
52
|
isToolCallInFlight?(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Called before each provider generation (child process) starts, including every
|
|
55
|
+
* relaunch a recovery wrapper or supervisor makes with the same handlers. Per-generation
|
|
56
|
+
* state, such as tool calls in flight, must be reset here: a generation that exited mid
|
|
57
|
+
* call never reports that call's completion.
|
|
58
|
+
*/
|
|
59
|
+
onGenerationStart?(): void;
|
|
53
60
|
}
|
|
54
61
|
/** Recovery must wrap the attempt coordinator, never its raw OS runner. Each
|
|
55
|
-
* relaunch needs a new fenced child generation and exclusive launch files.
|
|
62
|
+
* relaunch needs a new fenced child generation and exclusive launch files. The outer
|
|
63
|
+
* layer fails any run Forge stopped because its turn ended with background work live. */
|
|
56
64
|
export declare function recoveringProviderProcessRunner(inner: ProviderProcessRunner): ProviderProcessRunner;
|
|
57
65
|
/**
|
|
58
66
|
* Codex Desktop and an independently installed Codex CLI can briefly disagree
|
|
@@ -96,8 +104,8 @@ export declare class StreamingProviderProcessRunner implements ProviderProcessRu
|
|
|
96
104
|
}
|
|
97
105
|
/**
|
|
98
106
|
* The typed failure for a provider run that ended without calling its required Forge
|
|
99
|
-
* completion tool. A run Forge stopped at the success ceiling
|
|
100
|
-
* is not mistaken for an agent that simply ended its turn.
|
|
107
|
+
* completion tool. A run Forge stopped at the success ceiling or for background work is
|
|
108
|
+
* reported as such, so it is not mistaken for an agent that simply ended its turn.
|
|
101
109
|
*/
|
|
102
110
|
export declare function providerCompletionToolMissingFailure(message: string, result?: Pick<ProviderProcessRunResult, "terminalStopReason"> | null): ForgeFailureError;
|
|
103
111
|
/** Returns aggregate resident bytes for the exact supervised Unix process group. */
|
|
@@ -10,7 +10,8 @@ import { persistHostProcessSupervisorMetadata, resolveHostProcessSupervisedLaunc
|
|
|
10
10
|
import { buildWindowsLaunchCommand } from "../../shared/process/windows-launch.js";
|
|
11
11
|
import { assertHostDatabaseCapabilityBoundary } from "../../runtime/host-database-capability-boundary.js";
|
|
12
12
|
import { ForgeFailureError } from "../session.types.js";
|
|
13
|
-
import {
|
|
13
|
+
import { BackgroundWorkStopFailingRunner, ClaudeBackgroundTurnEndWatch, providerTurnEndedWithBackgroundWorkFailure } from "./claude-background-work.js";
|
|
14
|
+
import { hasNonterminalManagedCommand, isProviderTerminalFailure, isProviderTerminalSuccess, isProviderTurnActivity } from "./provider-in-flight-work.js";
|
|
14
15
|
const execFileAsync = promisify(execFile);
|
|
15
16
|
// Provider processes can emit many gigabytes over a long-running session. The
|
|
16
17
|
// line handlers stream that output to Forge as it arrives; the completed result
|
|
@@ -25,9 +26,10 @@ const PROVIDER_TERMINAL_SUCCESS_CEILING_MS = 10 * 60_000;
|
|
|
25
26
|
const PROVIDER_TERMINAL_WORK_POLL_MS = 1_000;
|
|
26
27
|
const maximumRecoverableCodexModelsCacheBytes = 16 * 1024 * 1024;
|
|
27
28
|
/** Recovery must wrap the attempt coordinator, never its raw OS runner. Each
|
|
28
|
-
* relaunch needs a new fenced child generation and exclusive launch files.
|
|
29
|
+
* relaunch needs a new fenced child generation and exclusive launch files. The outer
|
|
30
|
+
* layer fails any run Forge stopped because its turn ended with background work live. */
|
|
29
31
|
export function recoveringProviderProcessRunner(inner) {
|
|
30
|
-
return new CodexResumeRecoveringProcessRunner(new CodexModelsCacheRecoveringProcessRunner(inner));
|
|
32
|
+
return new BackgroundWorkStopFailingRunner(new CodexResumeRecoveringProcessRunner(new CodexModelsCacheRecoveringProcessRunner(inner)));
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Codex Desktop and an independently installed Codex CLI can briefly disagree
|
|
@@ -51,6 +53,7 @@ export class CodexModelsCacheRecoveringProcessRunner {
|
|
|
51
53
|
const recovered = await quarantineIncompatibleCodexModelsCache(request.env).catch(() => false);
|
|
52
54
|
if (!recovered || signal?.aborted)
|
|
53
55
|
return first;
|
|
56
|
+
handlers?.onGenerationStart?.();
|
|
54
57
|
return await this.inner.run(request, handlers, signal);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
@@ -73,7 +76,10 @@ export class CodexResumeRecoveringProcessRunner {
|
|
|
73
76
|
return first;
|
|
74
77
|
}
|
|
75
78
|
const fallback = codexFreshTurnRequest(request);
|
|
76
|
-
|
|
79
|
+
if (!fallback)
|
|
80
|
+
return first;
|
|
81
|
+
handlers?.onGenerationStart?.();
|
|
82
|
+
return await this.inner.run(fallback, handlers, signal);
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
function isRecoverableCodexResumeFailure(command, result) {
|
|
@@ -111,7 +117,8 @@ function codexFreshTurnRequest(request) {
|
|
|
111
117
|
const cd = args.splice(cdIndex, 2);
|
|
112
118
|
args.splice(args.length - 1, 0, ...cd);
|
|
113
119
|
}
|
|
114
|
-
|
|
120
|
+
// The fallback starts a fresh thread, so it has no replayed turn to discount.
|
|
121
|
+
return { ...request, args, resumesProviderThread: false };
|
|
115
122
|
}
|
|
116
123
|
function isCodexCommand(command) {
|
|
117
124
|
return path.parse(command).name.toLowerCase() === "codex";
|
|
@@ -329,6 +336,8 @@ export class StreamingProviderProcessRunner {
|
|
|
329
336
|
}
|
|
330
337
|
async run(request, handlers = {}, signal) {
|
|
331
338
|
assertHostDatabaseCapabilityBoundary();
|
|
339
|
+
// Every child this runner launches is a new generation, including supervisor retries.
|
|
340
|
+
handlers.onGenerationStart?.();
|
|
332
341
|
const providerLaunch = await resolveProviderProcessLaunch(request.command, request.args);
|
|
333
342
|
const supervisedLaunch = resolveHostProcessSupervisedLaunch(request, providerLaunch.command, providerLaunch.args);
|
|
334
343
|
// An unsupervised Unix provider still gets a dedicated process group so a
|
|
@@ -372,7 +381,7 @@ export class StreamingProviderProcessRunner {
|
|
|
372
381
|
const childStderr = child.stderr;
|
|
373
382
|
if (!childStdout || !childStderr) {
|
|
374
383
|
const pipeError = new Error("Provider process stdout/stderr streams were not piped.");
|
|
375
|
-
void terminate().then(() => reject(pipeError), terminationError => reject(new AggregateError([pipeError, terminationError], "Provider launch failed and its process tree could not be proven stopped.")));
|
|
384
|
+
void terminate().then(() => reject(pipeError), terminationError => reject(new AggregateError([pipeError, terminationError], "host_process_supervisor_termination_failed: Provider launch failed and its process tree could not be proven stopped.")));
|
|
376
385
|
return;
|
|
377
386
|
}
|
|
378
387
|
const stdout = new BoundedOutputTail(PROVIDER_OUTPUT_CAPTURE_LIMIT_CHARS);
|
|
@@ -394,8 +403,10 @@ export class StreamingProviderProcessRunner {
|
|
|
394
403
|
let terminalWorkTickRunning = false;
|
|
395
404
|
let latestTurnFailed = false;
|
|
396
405
|
let readiness = null;
|
|
406
|
+
const backgroundTurnEnd = new ClaudeBackgroundTurnEndWatch(request.command, this.terminalExitGraceMs, () => finishAfterTerminalSuccess("turn_ended_with_background_work"));
|
|
397
407
|
const cleanup = () => {
|
|
398
408
|
stopTerminalWorkTimer();
|
|
409
|
+
backgroundTurnEnd.stop();
|
|
399
410
|
graceIdleMs = null;
|
|
400
411
|
ceilingIdleMs = null;
|
|
401
412
|
signal?.removeEventListener("abort", abort);
|
|
@@ -408,7 +419,7 @@ export class StreamingProviderProcessRunner {
|
|
|
408
419
|
cleanup();
|
|
409
420
|
// Do not release the caller's reservation/worktree/port ownership until
|
|
410
421
|
// descendant termination has completed (or failed with explicit proof).
|
|
411
|
-
void terminate().then(() => reject(error), terminationError => reject(new AggregateError([error, terminationError], "Provider process failed and its process tree could not be proven stopped.")));
|
|
422
|
+
void terminate().then(() => reject(error), terminationError => reject(new AggregateError([error, terminationError], "host_process_supervisor_termination_failed: Provider process failed and its process tree could not be proven stopped.")));
|
|
412
423
|
};
|
|
413
424
|
const abort = () => {
|
|
414
425
|
if (!closed)
|
|
@@ -419,12 +430,10 @@ export class StreamingProviderProcessRunner {
|
|
|
419
430
|
// termination; only a failed termination proof rejects the run.
|
|
420
431
|
void terminate().catch(fail);
|
|
421
432
|
};
|
|
422
|
-
if (signal?.aborted)
|
|
433
|
+
if (signal?.aborted)
|
|
423
434
|
abort();
|
|
424
|
-
|
|
425
|
-
else {
|
|
435
|
+
else
|
|
426
436
|
signal?.addEventListener("abort", abort, { once: true });
|
|
427
|
-
}
|
|
428
437
|
child.on("error", fail);
|
|
429
438
|
const startGrant = startGated ? child.stdio[3] : null;
|
|
430
439
|
if (startGated && !startGrant) {
|
|
@@ -579,6 +588,7 @@ export class StreamingProviderProcessRunner {
|
|
|
579
588
|
if (request.captureOutput !== false)
|
|
580
589
|
stdout.appendLine(line);
|
|
581
590
|
const handled = handlers.onStdoutLine?.(line);
|
|
591
|
+
backgroundTurnEnd.consume(line);
|
|
582
592
|
if (!terminalTerminationStarted) {
|
|
583
593
|
if (isProviderTerminalSuccess(line)) {
|
|
584
594
|
latestTurnFailed = false;
|
|
@@ -595,11 +605,12 @@ export class StreamingProviderProcessRunner {
|
|
|
595
605
|
// the grace period restarts at its next terminal event.
|
|
596
606
|
graceIdleMs = null;
|
|
597
607
|
// A resumed session can replay a queued notification turn before the
|
|
598
|
-
// prompt's own turn.
|
|
599
|
-
// resumed agent is stopped mid-work
|
|
608
|
+
// prompt's own turn. The replayed turn must not consume the ceiling, or the
|
|
609
|
+
// resumed agent is stopped mid-work, but the prompt's turn still needs a
|
|
610
|
+
// watchdog: restart the ceiling from here instead of dropping it.
|
|
600
611
|
if (request.resumesProviderThread && terminalSuccessCount === 1 && !replayedTurnCeilingSkipped) {
|
|
601
612
|
replayedTurnCeilingSkipped = true;
|
|
602
|
-
ceilingIdleMs =
|
|
613
|
+
ceilingIdleMs = 0;
|
|
603
614
|
}
|
|
604
615
|
}
|
|
605
616
|
}
|
|
@@ -666,60 +677,17 @@ export class StreamingProviderProcessRunner {
|
|
|
666
677
|
}
|
|
667
678
|
/**
|
|
668
679
|
* The typed failure for a provider run that ended without calling its required Forge
|
|
669
|
-
* completion tool. A run Forge stopped at the success ceiling
|
|
670
|
-
* is not mistaken for an agent that simply ended its turn.
|
|
680
|
+
* completion tool. A run Forge stopped at the success ceiling or for background work is
|
|
681
|
+
* reported as such, so it is not mistaken for an agent that simply ended its turn.
|
|
671
682
|
*/
|
|
672
683
|
export function providerCompletionToolMissingFailure(message, result) {
|
|
684
|
+
if (result?.terminalStopReason === "turn_ended_with_background_work")
|
|
685
|
+
return providerTurnEndedWithBackgroundWorkFailure(message);
|
|
673
686
|
if (result?.terminalStopReason === "success_ceiling") {
|
|
674
687
|
return new ForgeFailureError("provider_terminated_at_turn_ceiling", `${message} Forge stopped the provider at its post-turn success ceiling while it was still working.`);
|
|
675
688
|
}
|
|
676
689
|
return new ForgeFailureError("provider_completion_tool_missing", message);
|
|
677
690
|
}
|
|
678
|
-
/** A stream event that shows the provider is working on a turn: model output or a tool result. */
|
|
679
|
-
function isProviderTurnActivity(line) {
|
|
680
|
-
const trimmed = line.trim();
|
|
681
|
-
if (!trimmed.startsWith("{"))
|
|
682
|
-
return false;
|
|
683
|
-
try {
|
|
684
|
-
const event = JSON.parse(trimmed);
|
|
685
|
-
return event.type === "assistant"
|
|
686
|
-
|| event.type === "user"
|
|
687
|
-
|| (event.type === "system" && event.subtype === "init")
|
|
688
|
-
|| event.type === "turn.started"
|
|
689
|
-
|| event.type === "item.started";
|
|
690
|
-
}
|
|
691
|
-
catch {
|
|
692
|
-
return false;
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
function isProviderTerminalFailure(line) {
|
|
696
|
-
const trimmed = line.trim();
|
|
697
|
-
if (!trimmed.startsWith("{"))
|
|
698
|
-
return false;
|
|
699
|
-
try {
|
|
700
|
-
const event = JSON.parse(trimmed);
|
|
701
|
-
// The same events the output parsers report as provider errors.
|
|
702
|
-
return event.type === "turn.failed"
|
|
703
|
-
|| event.type === "error"
|
|
704
|
-
|| (event.type === "result" && (event.subtype !== "success" || event.is_error === true));
|
|
705
|
-
}
|
|
706
|
-
catch {
|
|
707
|
-
return false;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
function isProviderTerminalSuccess(line) {
|
|
711
|
-
const trimmed = line.trim();
|
|
712
|
-
if (!trimmed.startsWith("{"))
|
|
713
|
-
return false;
|
|
714
|
-
try {
|
|
715
|
-
const event = JSON.parse(trimmed);
|
|
716
|
-
return event.type === "turn.completed"
|
|
717
|
-
|| (event.type === "result" && event.subtype === "success" && event.is_error !== true);
|
|
718
|
-
}
|
|
719
|
-
catch {
|
|
720
|
-
return false;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
691
|
class HostProcessTreeMemoryObserver {
|
|
724
692
|
launch;
|
|
725
693
|
processGroupId;
|
|
@@ -34,6 +34,8 @@ export declare function codexSandboxModeForPlatform(platform?: NodeJS.Platform,
|
|
|
34
34
|
export declare function buildArchitectPrompt(dispatch: RunOnceDispatchPacket): string;
|
|
35
35
|
export declare function architectDependencyInstruction(dispatch: RunOnceDispatchPacket): string;
|
|
36
36
|
export declare function designerRefInstruction(dispatch: RunOnceDispatchPacket): string;
|
|
37
|
+
export declare function designerRefBuildInstruction(dispatch: RunOnceDispatchPacket): string;
|
|
38
|
+
export declare function designerRefQaInstruction(dispatch: RunOnceDispatchPacket): string;
|
|
37
39
|
export declare function architectRevisionInstruction(dispatch: RunOnceDispatchPacket): string;
|
|
38
40
|
/**
|
|
39
41
|
* Headless providers must not end a turn to wait: Forge stops the provider shortly after
|