tryharness 0.7.54 → 0.7.57
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 +15 -16
- package/cli.mjs +377 -62
- package/lib/activity.mjs +10 -10
- package/lib/adapters.mjs +16 -0
- package/lib/agentBinaries.mjs +71 -0
- package/lib/agentRuntimeConfig.mjs +1 -1
- package/lib/agentRuntimes.mjs +9 -3
- package/lib/agentSignIn.mjs +271 -41
- package/lib/answers.mjs +5 -5
- package/lib/archetypes.d.ts +64 -0
- package/lib/archetypes.js +989 -0
- package/lib/asks.mjs +4 -4
- package/lib/audit.mjs +36 -13
- package/lib/backupSetup.mjs +4 -2
- package/lib/boardAccess.mjs +17 -11
- package/lib/boardBackup.mjs +6 -6
- package/lib/boardFileCommands.mjs +6 -6
- package/lib/boardFiles.mjs +13 -12
- package/lib/boardMirror.mjs +82 -47
- package/lib/boardProtocol.json +30 -1
- package/lib/boardWaits.mjs +2 -3
- package/lib/book.mjs +6 -6
- package/lib/bridge.mjs +5 -5
- package/lib/cards.mjs +2 -2
- package/lib/cloudAgents.mjs +216 -0
- package/lib/cloudAi.mjs +1312 -0
- package/lib/cloudAssistants.mjs +242 -0
- package/lib/cloudBoot.mjs +81 -86
- package/lib/cloudSave.mjs +197 -0
- package/lib/cloudSsh.mjs +178 -0
- package/lib/context.mjs +3 -3
- package/lib/contractGate.mjs +34 -12
- package/lib/control-client.mjs +9 -1
- package/lib/controlSocket.mjs +86 -0
- package/lib/coordinator.mjs +103 -101
- package/lib/daemon.mjs +1128 -2865
- package/lib/desk.mjs +7 -6
- package/lib/desktop.mjs +72 -68
- package/lib/directLink.mjs +16 -5
- package/lib/environment.mjs +2 -1
- package/lib/environments.mjs +14 -6
- package/lib/firewall.mjs +9 -9
- package/lib/folders.mjs +18 -14
- package/lib/frames.mjs +2 -3
- package/lib/gitHost.mjs +3 -3
- package/lib/goalCommands.mjs +25 -7
- package/lib/goals.mjs +7 -7
- package/lib/guestRequests.mjs +94 -0
- package/lib/handoffs.mjs +8 -7
- package/lib/handover.mjs +4 -4
- package/lib/harnessModel.mjs +6 -6
- package/lib/harnessOffers.mjs +266 -0
- package/lib/inference.mjs +26 -8
- package/lib/jobAnswers.mjs +190 -0
- package/lib/landed.mjs +1 -1
- package/lib/lane.mjs +42 -11
- package/lib/lessons.mjs +16 -16
- package/lib/library.mjs +3 -3
- package/lib/lineup.mjs +3 -0
- package/lib/linkRelay.mjs +574 -0
- package/lib/localAgentAsk.mjs +74 -0
- package/lib/localStack.mjs +536 -0
- package/lib/localmodels.mjs +6 -4
- package/lib/loopBackstop.mjs +4 -4
- package/lib/machineIdentity.mjs +9 -1
- package/lib/machineRoutes.mjs +181 -2
- package/lib/machineRuns.mjs +76 -1
- package/lib/machineSeal.mjs +39 -12
- package/lib/mcp-stdio.mjs +96 -26
- package/lib/mcpRelay.mjs +1 -1
- package/lib/members.json +13 -0
- package/lib/members.mjs +1 -1
- package/lib/models.mjs +77 -23
- package/lib/museSession.mjs +6 -1
- package/lib/nativeHost.mjs +35 -7
- package/lib/network.mjs +50 -5
- package/lib/notify.mjs +7 -5
- package/lib/nudge.mjs +3 -3
- package/lib/ocr.mjs +9 -9
- package/lib/onboard.mjs +26 -20
- package/lib/oneLine.mjs +7 -7
- package/lib/ownMachines.mjs +928 -149
- package/lib/pairing.mjs +33 -6
- package/lib/paths.mjs +15 -1
- package/lib/peerProcess.mjs +124 -0
- package/lib/personModel.mjs +3 -3
- package/lib/personNotices.mjs +151 -0
- package/lib/phones.mjs +490 -38
- package/lib/placeCommands.mjs +4 -4
- package/lib/places.mjs +70 -2
- package/lib/profile.mjs +67 -14
- package/lib/projectGit.mjs +158 -14
- package/lib/projectPieces.mjs +902 -0
- package/lib/projectSettings.mjs +7 -4
- package/lib/projects.mjs +384 -62
- package/lib/provenance.mjs +5 -1
- package/lib/proxyLinks.mjs +267 -0
- package/lib/reactions.mjs +7 -5
- package/lib/readiness.mjs +12 -7
- package/lib/record.mjs +19 -6
- package/lib/redact.mjs +4 -4
- package/lib/relayLimits.mjs +62 -0
- package/lib/release.mjs +170 -0
- package/lib/releaseKeys.json +6 -0
- package/lib/repoLinks.mjs +4 -4
- package/lib/roomChannels.mjs +24 -0
- package/lib/roomPage.mjs +1 -1
- package/lib/runAuthority.mjs +101 -0
- package/lib/runBrief.mjs +19 -8
- package/lib/runWorker.mjs +14 -5
- package/lib/runner.mjs +215 -25
- package/lib/runtime-install.mjs +143 -9
- package/lib/schedules.mjs +2 -2
- package/lib/screens.mjs +1 -1
- package/lib/sealed.mjs +11 -2
- package/lib/sealedThreads.mjs +671 -0
- package/lib/secretPatterns.json +1 -1
- package/lib/secrets.mjs +4 -4
- package/lib/seen.mjs +6 -6
- package/lib/serverWords.mjs +175 -0
- package/lib/service.mjs +22 -12
- package/lib/sessionControl.mjs +6 -6
- package/lib/specialties.mjs +6 -6
- package/lib/specialtyKeys.js +4 -5
- package/lib/specialtyNotice.mjs +7 -7
- package/lib/specialtySnapshot.mjs +5 -5
- package/lib/speech.mjs +5 -5
- package/lib/store.mjs +140 -39
- package/lib/stuck.mjs +1 -1
- package/lib/swarm.mjs +167 -16
- package/lib/swarmDevices.mjs +319 -0
- package/lib/swarmMemory.mjs +27 -25
- package/lib/t3.mjs +13 -13
- package/lib/taskCommands.mjs +44 -11
- package/lib/taskRooms.mjs +125 -0
- package/lib/taskRuns.mjs +36 -1
- package/lib/team.mjs +41 -18
- package/lib/threadActions.mjs +315 -0
- package/lib/threadAuthority.mjs +101 -0
- package/lib/threadBriefs.mjs +178 -0
- package/lib/threadLine.mjs +2 -2
- package/lib/threadRuns.mjs +138 -43
- package/lib/threadView.mjs +5 -5
- package/lib/usageTotals.mjs +2 -3
- package/lib/vault.mjs +101 -10
- package/lib/vaultCloud.mjs +2 -2
- package/lib/vaultCommands.mjs +15 -6
- package/lib/vaultTools.js +2 -2
- package/lib/verdicts.mjs +328 -0
- package/lib/wakes.mjs +1 -1
- package/lib/watches.mjs +2 -2
- package/lib/windowAsks.mjs +13 -5
- package/lib/worktrees.mjs +112 -18
- package/npm-shrinkwrap.json +1093 -0
- package/package.json +11 -10
- package/release.json +220 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "The public halves of Harness's release keys (release.mjs). An installed runtime installs only releases signed by one of these. Empty until the owner runs packages/desktop/scripts/release-key.mjs.",
|
|
3
|
+
"keys": [
|
|
4
|
+
"MCowBQYDK2VwAyEArul+f77Jncfc+LSz3rmeNdNWxGbbEuxxIgT4OePwpEU="
|
|
5
|
+
]
|
|
6
|
+
}
|
package/lib/repoLinks.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { randomUUID } from "node:crypto";
|
|
|
13
13
|
// board.repo.find { link } → { repo, here: folder | null, places: [folders to clone into] }
|
|
14
14
|
// board.repo.clone { link, parent } → { folder }
|
|
15
15
|
// With detached:true, clone returns {operation,state:"cloning"}; board.repo.clone.read {operation} returns progress
|
|
16
|
-
// or the final result. Short calls fit existing browser/buddy transports while the
|
|
16
|
+
// or the final result. Short calls fit existing browser/buddy transports while the clone's own deadline runs here.
|
|
17
17
|
// Then board.project.create { folder } (or board.project.join { folder }) starts or joins the room as for any folder.
|
|
18
18
|
|
|
19
19
|
const HOSTS = ["github.com", "gitlab.com", "bitbucket.org", "codeberg.org"];
|
|
@@ -175,9 +175,9 @@ export function findHere({ link, folders = [], homeDir = os.homedir() }) {
|
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
// How long a clone may wait for the remote to answer: 2 minutes,
|
|
179
|
-
//
|
|
180
|
-
//
|
|
178
|
+
// How long a clone may wait for the remote to answer: 2 minutes, a chosen value, not yet measured against real GitHub
|
|
179
|
+
// clones. It covers only the wait for the remote's first byte; once the remote is answering, a large repository takes
|
|
180
|
+
// as long as its transfer does.
|
|
181
181
|
export const FIRST_BYTE_MS = 120_000;
|
|
182
182
|
|
|
183
183
|
// What git says before the remote has answered: its own "Cloning into '<folder>'..." line.
|
package/lib/roomChannels.mjs
CHANGED
|
@@ -505,6 +505,27 @@ export function createRoomChannels({
|
|
|
505
505
|
publish(updated, [...peersFor(id), peer]);
|
|
506
506
|
notify(room, updated);
|
|
507
507
|
};
|
|
508
|
+
// The person blocked someone: the owner takes them out of the room; anyone else ends their pair channel with them
|
|
509
|
+
// and keeps it ended (sync never links an errored peer again).
|
|
510
|
+
const block = (id, peer) => {
|
|
511
|
+
const room = read(id);
|
|
512
|
+
if (!room || !joined(room)) return;
|
|
513
|
+
if (
|
|
514
|
+
room.owner === room.me &&
|
|
515
|
+
room.members.some(
|
|
516
|
+
(member) =>
|
|
517
|
+
member.handle === peer &&
|
|
518
|
+
["invited", "joined"].includes(member.status)
|
|
519
|
+
)
|
|
520
|
+
)
|
|
521
|
+
remove(id, peer);
|
|
522
|
+
for (const route of routes(id).filter((entry) => entry.peer === peer)) {
|
|
523
|
+
end(route.id, "Blocked.");
|
|
524
|
+
forget(route);
|
|
525
|
+
}
|
|
526
|
+
const fresh = read(id);
|
|
527
|
+
save(fresh, { errors: { ...fresh.errors, [peer]: "Blocked." } });
|
|
528
|
+
};
|
|
508
529
|
const closed = (channelId) => {
|
|
509
530
|
const route = channel(channelId);
|
|
510
531
|
if (!route) return false;
|
|
@@ -620,12 +641,15 @@ export function createRoomChannels({
|
|
|
620
641
|
knowsChannel: (id) =>
|
|
621
642
|
Boolean(channel(id) || store.meta(`shared-room-channel:${id}`)),
|
|
622
643
|
invite,
|
|
644
|
+
// Whether an invitation names its real sender and this person, as join requires; throws why not.
|
|
645
|
+
validate: validateInvite,
|
|
623
646
|
join,
|
|
624
647
|
setAgents,
|
|
625
648
|
opened,
|
|
626
649
|
receive,
|
|
627
650
|
leave,
|
|
628
651
|
remove,
|
|
652
|
+
block,
|
|
629
653
|
closed,
|
|
630
654
|
sync,
|
|
631
655
|
retry,
|
package/lib/roomPage.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// One page of a thread's room as any agent reads it: its newest posts, the ones before a post (`before`) going back, or
|
|
2
2
|
// the ones after a post (`since`) catching up. Each page says where the posts on either side of it start, and fits in
|
|
3
|
-
// one tool result (
|
|
3
|
+
// one tool result (27 posts of one video thread came to 64,553 characters, more than Claude Code takes in one).
|
|
4
4
|
const PAGE_CHARS = 30_000;
|
|
5
5
|
const PAGE_POSTS = 50;
|
|
6
6
|
|
package/lib/runAuthority.mjs
CHANGED
|
@@ -5,6 +5,65 @@ import { spawnSync } from "node:child_process";
|
|
|
5
5
|
import { PS } from "./nudge.mjs";
|
|
6
6
|
import { paths } from "./paths.mjs";
|
|
7
7
|
import { MACHINE_RUNNERS } from "./members.mjs";
|
|
8
|
+
import { runCapability, runningPids } from "./runner.mjs";
|
|
9
|
+
import {
|
|
10
|
+
descendsFrom,
|
|
11
|
+
peerPids,
|
|
12
|
+
processParents,
|
|
13
|
+
seesPeers,
|
|
14
|
+
} from "./peerProcess.mjs";
|
|
15
|
+
|
|
16
|
+
/** The run Harness started that made a socket call, set by checkCaller; no JSON a caller writes can set it. */
|
|
17
|
+
export const RUN_CALLER = Symbol("the run that called");
|
|
18
|
+
/** How the run that made a call was held in, so what it asks for is held in too: "review", "restricted" or null. */
|
|
19
|
+
export const callerLimit = (request) => {
|
|
20
|
+
const run = request?.[RUN_CALLER];
|
|
21
|
+
return run?.review ? "review" : run?.restricted ? "restricted" : null;
|
|
22
|
+
};
|
|
23
|
+
/** Whether a call came from a run that may not act on the person's go: a restricted run or a read-only review. */
|
|
24
|
+
export const limitedCaller = (request) => callerLimit(request) !== null;
|
|
25
|
+
|
|
26
|
+
// What a run Harness started may ask on the daemon's socket: the board (as itself, under its own limits), Harness's
|
|
27
|
+
// tools through the relay, and reading how things stand. Everything else there is the person's: pairing a phone,
|
|
28
|
+
// backups, computers, local folders, stopping runs, Lid-Closed Mode, shutting the daemon down.
|
|
29
|
+
const RUN_COMMANDS = new Set([
|
|
30
|
+
"status",
|
|
31
|
+
"doctor",
|
|
32
|
+
"activity",
|
|
33
|
+
"sync",
|
|
34
|
+
"local.status",
|
|
35
|
+
"voice.status",
|
|
36
|
+
"image.read",
|
|
37
|
+
"session.compacted",
|
|
38
|
+
"tasks.get",
|
|
39
|
+
"runs.here",
|
|
40
|
+
"wake.local",
|
|
41
|
+
"t3.status",
|
|
42
|
+
"phone.identity",
|
|
43
|
+
"machine.report",
|
|
44
|
+
]);
|
|
45
|
+
// Reading the board as the person: what these answer is already in the board's own file, which a program a run starts
|
|
46
|
+
// outside its sandbox can read anyway, while a sandboxed run's shell cannot reach this socket at all. They skip the
|
|
47
|
+
// check of who called (a lookup of the socket's other end, ~35 ms), which the buddy's reads would otherwise pay on
|
|
48
|
+
// every call while a run is going; anything that acts, or reads more than the board, keeps it.
|
|
49
|
+
const PERSON_READS = new Set([
|
|
50
|
+
"status",
|
|
51
|
+
"board.list",
|
|
52
|
+
"board.get",
|
|
53
|
+
"board.children",
|
|
54
|
+
"board.agents",
|
|
55
|
+
"board.wait",
|
|
56
|
+
"board.goal.list",
|
|
57
|
+
"board.goal.get",
|
|
58
|
+
"board.room.read",
|
|
59
|
+
"board.thread.read",
|
|
60
|
+
"board.swarm.list",
|
|
61
|
+
"board.swarm.read",
|
|
62
|
+
]);
|
|
63
|
+
const runMayAsk = (command) =>
|
|
64
|
+
command.startsWith("board.") ||
|
|
65
|
+
command.startsWith("mcp.") ||
|
|
66
|
+
RUN_COMMANDS.has(command);
|
|
8
67
|
|
|
9
68
|
export function createRunAuthority({ store, installedAgents }) {
|
|
10
69
|
const RUNNERS = new Set(MACHINE_RUNNERS);
|
|
@@ -91,6 +150,47 @@ export function createRunAuthority({ store, installedAgents }) {
|
|
|
91
150
|
: { started: false, reason: `It could not be authorized. ${start}` };
|
|
92
151
|
};
|
|
93
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Who a call on the local socket is, before anything acts on it; a refusal to answer with, or null. A call carrying a
|
|
155
|
+
* run's capability is that run's agent with that run's limits, whatever agent it names. Without one, a call as the
|
|
156
|
+
* person (or for something only the person does) is refused when the program that made it is inside a run this
|
|
157
|
+
* daemon started: its capability was dropped on the way. The person's own sessions and terminal are not runs.
|
|
158
|
+
*/
|
|
159
|
+
const checkCaller = async (request, socket) => {
|
|
160
|
+
const command = String(request.command || "");
|
|
161
|
+
if (request.runToken !== undefined) {
|
|
162
|
+
const run = runCapability(request.runToken);
|
|
163
|
+
delete request.runToken;
|
|
164
|
+
if (!run)
|
|
165
|
+
return "That run has ended, so Harness does not take its calls.";
|
|
166
|
+
request.agent = run.agent;
|
|
167
|
+
if (run.restricted) request.restricted = true;
|
|
168
|
+
request[RUN_CALLER] = run;
|
|
169
|
+
if (!runMayAsk(command))
|
|
170
|
+
return "A run Harness started cannot do that; only the person can.";
|
|
171
|
+
if (run.restricted && command.startsWith("mcp."))
|
|
172
|
+
return "A restricted run reaches this computer's board, not the person's Harness.";
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
if (request.agent !== "user" && runMayAsk(command)) return null;
|
|
176
|
+
if (PERSON_READS.has(command)) return null;
|
|
177
|
+
const runs = runningPids();
|
|
178
|
+
// Windows has no tool here that names a named pipe's client; there the capability alone tells a run's calls apart.
|
|
179
|
+
if (!runs.length || !seesPeers) return null;
|
|
180
|
+
// A caller that cannot be found (it hung up as soon as it wrote) is not taken as the person either.
|
|
181
|
+
const [peers, parents] = await Promise.all([
|
|
182
|
+
peerPids(socket),
|
|
183
|
+
processParents(),
|
|
184
|
+
]);
|
|
185
|
+
const inside =
|
|
186
|
+
peers?.length && parents ? descendsFrom(peers, runs, parents) : null;
|
|
187
|
+
if (inside === null)
|
|
188
|
+
return "Harness could not tell which program asked, so it did not act as the person. Try again.";
|
|
189
|
+
return inside
|
|
190
|
+
? "A program inside a run Harness started cannot act as the person."
|
|
191
|
+
: null;
|
|
192
|
+
};
|
|
193
|
+
|
|
94
194
|
const markPrompt = (pids, agent) => {
|
|
95
195
|
for (const pid of Array.isArray(pids) ? pids.slice(0, 2) : [])
|
|
96
196
|
if (Number.isInteger(pid) && pid > 1) promptedBy.set(pid, agent);
|
|
@@ -104,6 +204,7 @@ export function createRunAuthority({ store, installedAgents }) {
|
|
|
104
204
|
standingRules,
|
|
105
205
|
standingVerdict,
|
|
106
206
|
applyStanding,
|
|
207
|
+
checkCaller,
|
|
107
208
|
markPrompt,
|
|
108
209
|
};
|
|
109
210
|
}
|
package/lib/runBrief.mjs
CHANGED
|
@@ -11,13 +11,13 @@ import { profileBrief, readProfile } from "./profile.mjs";
|
|
|
11
11
|
// largest sections give way to their pointers. Every run keeps what each section weighed and what was sent of it
|
|
12
12
|
// (`brief-sections:<run>`), and `tryharness board brief <task> --dry-run` shows the same brief before any run.
|
|
13
13
|
|
|
14
|
-
// The budget, measured on
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
14
|
+
// The budget, measured on one real board: the briefs 52 runs of Claude Code and Codex actually got (read from their own
|
|
15
|
+
// session files) were 7,173 characters at the median, 21,279 at p90 and 31,725 at most; the core (provenance,
|
|
16
|
+
// objective, the task's brief or the thread's wake brief) made up 6,790 / 18,660 / 29,745 of that, the room digest
|
|
17
|
+
// inside the wake brief alone up to 15,136. The other parts were small: room guide up to 3,236, task frame 946, lessons
|
|
18
|
+
// 306, context pack files 869, earlier sessions 844, library 301; no run carried claude-mem notes, which can reach
|
|
19
|
+
// 20,000 on their own (claudemem.mjs). The budget keeps every brief a run worked from whole, and gives way beyond it: a
|
|
20
|
+
// large claude-mem note or a growing roster no longer stacks on top of a full thread.
|
|
21
21
|
export const BRIEF_BUDGET = 32_000;
|
|
22
22
|
|
|
23
23
|
export function createRunBriefs({
|
|
@@ -210,7 +210,18 @@ export function createRunBriefs({
|
|
|
210
210
|
priority: "recommended",
|
|
211
211
|
source: "Harness profile",
|
|
212
212
|
text: person ? profileBrief(person) : "",
|
|
213
|
-
pointer: person
|
|
213
|
+
pointer: person
|
|
214
|
+
? [
|
|
215
|
+
person.displayName
|
|
216
|
+
? `You are working for ${person.displayName}.`
|
|
217
|
+
: "",
|
|
218
|
+
person.archetype
|
|
219
|
+
? `Primary archetype: ${person.archetype}. Read its workflows with archetype.`
|
|
220
|
+
: "",
|
|
221
|
+
]
|
|
222
|
+
.filter(Boolean)
|
|
223
|
+
.join(" ")
|
|
224
|
+
: "",
|
|
214
225
|
},
|
|
215
226
|
{
|
|
216
227
|
name: "task frame",
|
package/lib/runWorker.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { sessionFile } from "./live.mjs";
|
|
|
8
8
|
import { oneLine } from "./oneLine.mjs";
|
|
9
9
|
|
|
10
10
|
// `briefs` (runBrief.mjs) says what each run is told and which session it continues.
|
|
11
|
-
/** Another agent's words on a goal's authority, without the person's tap or go (person-wake): restricted
|
|
11
|
+
/** Another agent's words on a goal's authority, without the person's tap or go (person-wake): restricted. */
|
|
12
12
|
export const restrictedRun = (store, task) =>
|
|
13
13
|
task.trust !== "user" &&
|
|
14
14
|
task.run_authorized_by === "goal" &&
|
|
@@ -56,7 +56,7 @@ export function createRunWorker({
|
|
|
56
56
|
}
|
|
57
57
|
// Where a run works, one at a time: its folder, or for a turn T3 Code carries out, its thread (T3 keeps the checkout).
|
|
58
58
|
// A review changes nothing (runner.mjs runs it read-only), so it goes beside whoever writes there: one review per
|
|
59
|
-
// agent per thread, as its session is one (
|
|
59
|
+
// agent per thread, as its session is one (reviews once waited 168 min behind other agents' turns in 3 days).
|
|
60
60
|
const slotOf = (task) =>
|
|
61
61
|
store.meta(`review:${task.id}`) === "1"
|
|
62
62
|
? `review:${task.target_agent}:${task.parent_id}`
|
|
@@ -159,12 +159,15 @@ export function createRunWorker({
|
|
|
159
159
|
} = await briefs.prepare(task, agent);
|
|
160
160
|
const startedAt = new Date().toISOString();
|
|
161
161
|
const stoppedFor = Boolean(again);
|
|
162
|
-
// The session it resumes is the run's from its first moment, so Open never resumes it beside the run before the
|
|
163
|
-
// says which session it is in (
|
|
162
|
+
// The session it resumes is the run's from its first moment, so Open never resumes it beside the run before the
|
|
163
|
+
// agent says which session it is in (OpenCode once said so only minutes into its turn).
|
|
164
164
|
if (resumeSession && !task.session_id)
|
|
165
165
|
store.setRunSession(task.id, resumeSession);
|
|
166
166
|
const readOnly = store.meta(`review:${task.id}`) === "1";
|
|
167
167
|
const restricted = restrictedRun(store, task);
|
|
168
|
+
// Work another person asked for runs with only this person's own agent settings: the repository's own (its
|
|
169
|
+
// .claude hooks, .pi, opencode.json) can be that person's, and would run here (security audit P4, October 25).
|
|
170
|
+
const ownSettingsOnly = store.meta(`other-person-run:${task.id}`) === "1";
|
|
168
171
|
const chosen = await modelForRun(task, agent);
|
|
169
172
|
store.setRunModel(task.id, chosen);
|
|
170
173
|
const { model, effort } = chosen;
|
|
@@ -183,10 +186,13 @@ export function createRunWorker({
|
|
|
183
186
|
cwd: task.run_workspace,
|
|
184
187
|
...(model ? { model } : {}),
|
|
185
188
|
...(effort ? { effort } : {}),
|
|
189
|
+
// A model of Harness's AI says its window and longest answer, for an agent told them per run (runner.mjs).
|
|
190
|
+
...(model && chosen.limits ? { limits: chosen.limits } : {}),
|
|
186
191
|
...(stoppedFor ? { again: true } : {}),
|
|
187
192
|
...(resumeSession && !t3 ? { resumeSession } : {}),
|
|
188
193
|
...(readOnly ? { readOnly } : {}),
|
|
189
194
|
...(restricted ? { restricted } : {}),
|
|
195
|
+
...(ownSettingsOnly ? { ownSettingsOnly } : {}),
|
|
190
196
|
...(t3 ? { t3 } : {}),
|
|
191
197
|
...(granted ? { env: granted.env, scrub: granted.values } : {}),
|
|
192
198
|
},
|
|
@@ -243,7 +249,10 @@ export function createRunWorker({
|
|
|
243
249
|
const reported = store.reportTask(task.id, agent, {
|
|
244
250
|
status: kind,
|
|
245
251
|
result: text || "",
|
|
246
|
-
|
|
252
|
+
// Stopped for the person's steer (threadRuns.mjs): the person ended it, not the agent or its provider.
|
|
253
|
+
failure: store.meta(`steered:${task.id}`)
|
|
254
|
+
? "person"
|
|
255
|
+
: (extra?.failure ?? "exit"),
|
|
247
256
|
});
|
|
248
257
|
if (reported.ok) notifyBoard(reported.task);
|
|
249
258
|
else
|