Skip to content

Commit b00a5ef

Browse files
authored
Merge branch 'main' into cursor/self-contained-browser-signin-c51f
2 parents ac3e2d9 + 1b112a3 commit b00a5ef

18 files changed

Lines changed: 1994 additions & 513 deletions

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ permissions:
1919
contents: read
2020

2121
# The newest push on a pull request wins. Every commit on main keeps its own run, for the badge and
22-
# for the release: publishing a release relies on main's CI having passed on the commit the release
23-
# PR merged onto (scripts/release-ci-gate.ts). In one group, a push landing while another commit's
24-
# run was in progress replaced the pending run of the commit before it, and that commit never got a
25-
# result.
22+
# for the release: publishing a release relies on main's CI having passed on a commit whose tree
23+
# differs from the release's only in what it runs again (scripts/release-ci-gate.ts). In one group,
24+
# a push landing while another commit's run was in progress replaced the pending run of the commit
25+
# before it, and that commit never got a result.
2626
#
2727
# `github.workflow` keeps the release's own call of these checks out of main's group. A called
2828
# workflow sees its caller's context, so without it Publish release's checks shared

‎.github/workflows/publish-release.yml‎

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -253,40 +253,53 @@ jobs:
253253
echo "becomes_latest=$becomes_latest" >> "$GITHUB_OUTPUT"
254254
echo "$VERSION becomes the latest release: $becomes_latest."
255255
256-
# Whether the full CI suite runs again on the release commit (scripts/release-ci-gate.ts). A release
257-
# PR that changes only the release files (the versions, CHANGELOG.md and release-policy.json),
258-
# merged onto a commit main's CI passed, has a tree that has already been through every check, so
259-
# `checks` below is skipped and that run stands in for it. Anything else in the diff, or a parent
260-
# whose CI did not pass, runs the full suite as before. When the suite is skipped, the checks CI
261-
# makes that read the release files run here instead, so a changelog or policy edited in the
262-
# release PR is still held to them.
256+
# What runs on the release commit (scripts/release-ci-gate.ts): no test runs again on a tree that
257+
# already passed it. The gate looks for a commit whose CI passed (the release commit itself, its
258+
# first parents, or main's) and whose tree differs from the release commit's in nothing a run
259+
# would check differently, and runs only the difference:
260+
#
261+
# - `reuse`, the same tree, a revert back to a tree that passed included: nothing runs again, but
262+
# the support window, which counts from the day of the release.
263+
# - `release-files`, only the versions, CHANGELOG.md and release-policy.json differ: the checks
264+
# that read them run here.
265+
# - `tests`, only those and the suite's test files differ: the release-file checks and types run
266+
# here, and the changed tests, in each engine they run in, in `release tests`.
267+
# - `full`, anything else, or anything it cannot read: `checks` below runs the full suite.
263268
gate:
264269
name: checks needed
265270
needs: [metadata, verify]
266271
if: needs.metadata.outputs.is_release == 'true'
267272
runs-on: ubuntu-latest
268-
# The decision waits up to 10 minutes for main's CI on the parent while it is still running
273+
# The decision waits up to 10 minutes for CI still running on a commit that would stand in
269274
# (MAX_WAIT_SECONDS in the script), then the release-file checks below run.
270275
timeout-minutes: 20
271276
permissions:
272277
contents: read
273-
# To read main's CI runs.
278+
# To read the CI runs that stand in.
274279
actions: read
275280
outputs:
276281
full_checks: ${{ steps.decide.outputs.full_checks }}
282+
mode: ${{ steps.decide.outputs.mode }}
283+
tests: ${{ steps.decide.outputs.tests }}
284+
browser_tests: ${{ steps.decide.outputs.browser_tests }}
285+
webkit_tests: ${{ steps.decide.outputs.webkit_tests }}
286+
desktop_browser_tests: ${{ steps.decide.outputs.desktop_browser_tests }}
277287
steps:
278-
# The release commit and its parent, which the decision compares.
288+
# The release commit and the history it is compared with: its own first parents, and main's
289+
# for a release branch. Without file contents, which the decision fetches for the few files it
290+
# reads; the release commit's own tree is checked out whole.
279291
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
280292
with:
281293
ref: ${{ github.sha }}
282-
fetch-depth: 2
294+
fetch-depth: 0
295+
filter: blob:none
283296
persist-credentials: false
284297
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
285298
with:
286299
bun-version: 1.4.3
287300
no-cache: true
288301
- id: decide
289-
name: Decide whether the full checks run again
302+
name: Decide what runs again
290303
env:
291304
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
292305
run: bun scripts/release-ci-gate.ts "$GITHUB_SHA"
@@ -295,18 +308,22 @@ jobs:
295308
# CI's `format, lint, types` job formats and lints package.json and the policy, and checks the
296309
# versions the release moved still agree with each other.
297310
- name: Format and lint
298-
if: steps.decide.outputs.full_checks == 'false'
311+
if: steps.decide.outputs.mode == 'release-files' || steps.decide.outputs.mode == 'tests'
299312
run: |
300313
set -euo pipefail
301314
bun run format:check
302315
bun run lint
316+
# The changed tests are type checked, as CI's `format, lint, types` would.
317+
- name: Types
318+
if: steps.decide.outputs.mode == 'tests'
319+
run: bun run typecheck
303320
- name: Desktop version tracks the release version
304-
if: steps.decide.outputs.full_checks == 'false'
321+
if: steps.decide.outputs.mode == 'release-files' || steps.decide.outputs.mode == 'tests'
305322
run: bun desktop/scripts/desktop-version.ts check
306323
# Every test that reads the changelog or the policy, found by name so a new one is included
307324
# without anybody adding it here.
308325
- name: The tests that read CHANGELOG.md and release-policy.json
309-
if: steps.decide.outputs.full_checks == 'false'
326+
if: steps.decide.outputs.mode == 'release-files' || steps.decide.outputs.mode == 'tests'
310327
run: |
311328
set -euo pipefail
312329
tests=()
@@ -329,9 +346,50 @@ jobs:
329346
if: steps.decide.outputs.full_checks == 'false'
330347
run: bun scripts/support-window.ts check --releases "$RUNNER_TEMP/releases.json"
331348

332-
# The same checks CI runs, against the commit being published, unless `gate` found the release
333-
# commit is the release files on a commit main's CI passed. This or that run is the gate: nothing is
334-
# built or tagged unless one of them passed on this tree.
349+
# The test files the release commit changed from the tree whose CI passed, with every test that
350+
# names one, when `gate` found nothing else changed: each in the engines CI runs it in, as CI's
351+
# `tests (changed files)` runs them (scripts/ci-run-tests.ts). A browser test runs in Chromium, and
352+
# in WebKit too when it asks for it; the desktop setup window's from desktop/.
353+
release-tests:
354+
name: release tests
355+
needs: [metadata, verify, gate]
356+
if: needs.metadata.outputs.is_release == 'true' && needs.gate.outputs.mode == 'tests'
357+
runs-on: ubuntu-latest
358+
timeout-minutes: 25 # installs the browsers it needs, then runs a few files
359+
permissions:
360+
contents: read
361+
steps:
362+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
363+
with:
364+
ref: ${{ github.sha }}
365+
persist-credentials: false
366+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
367+
with:
368+
bun-version: 1.4.3
369+
no-cache: true
370+
# The same installs as CI's, since a changed file can be anywhere the suite looks.
371+
- run: bun install --frozen-lockfile
372+
- run: bun install --frozen-lockfile
373+
working-directory: agent-mastra
374+
- run: bun install --frozen-lockfile
375+
working-directory: desktop
376+
- name: Install Chromium
377+
if: needs.gate.outputs.browser_tests != '[]' || needs.gate.outputs.desktop_browser_tests != '[]'
378+
run: bunx playwright-core install --with-deps --no-shell chromium
379+
- name: Install WebKit
380+
if: needs.gate.outputs.webkit_tests != '[]'
381+
run: bunx playwright-core install --with-deps webkit
382+
- name: Run the changed tests
383+
env:
384+
TESTS: ${{ needs.gate.outputs.tests }}
385+
BROWSER_TESTS: ${{ needs.gate.outputs.browser_tests }}
386+
WEBKIT_TESTS: ${{ needs.gate.outputs.webkit_tests }}
387+
DESKTOP_BROWSER_TESTS: ${{ needs.gate.outputs.desktop_browser_tests }}
388+
run: bun scripts/ci-run-tests.ts
389+
390+
# The same checks CI runs, against the commit being published, unless `gate` found a tree whose CI
391+
# passed that differs from this one only in the release files and tests. This or that run is the
392+
# gate: nothing is built or tagged unless one of them passed on this tree.
335393
checks:
336394
needs: [metadata, verify, gate]
337395
if: needs.metadata.outputs.is_release == 'true' && needs.gate.outputs.full_checks == 'true'
@@ -354,15 +412,18 @@ jobs:
354412
# decision made in `verify`, the same one that marks the GitHub release Latest: whoever pulls
355413
# `latest` gets the newest stable release, never a candidate, a beta or an older patch.
356414
#
357-
# After `checks` passed, or after `gate` passed having decided `checks` need not run. Nothing else:
358-
# a `checks` skipped for any other reason, or a `gate` that failed, publishes nothing.
415+
# After `checks` passed, or after `gate` passed having decided `checks` need not run, and the
416+
# changed tests passed when it decided they run. Nothing else: a `checks` or `release tests`
417+
# skipped for any other reason, or a `gate` that failed, publishes nothing.
359418
images:
360-
needs: [metadata, verify, gate, checks]
419+
needs: [metadata, verify, gate, release-tests, checks]
361420
if: >-
362421
!cancelled() && needs.metadata.outputs.is_release == 'true' &&
363422
needs.verify.result == 'success' && needs.gate.result == 'success' &&
364423
(needs.checks.result == 'success' ||
365-
(needs.checks.result == 'skipped' && needs.gate.outputs.full_checks == 'false'))
424+
(needs.checks.result == 'skipped' && needs.gate.outputs.full_checks == 'false' &&
425+
(needs.release-tests.result == 'success' ||
426+
(needs.release-tests.result == 'skipped' && needs.gate.outputs.mode != 'tests'))))
366427
uses: $/.github/workflows/images.yml
367428
with:
368429
ref: ${{ github.sha }}

‎agent-claude-sdk/tests/fixtures/server-instructions.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎app/src/components/channels/subtask-step.tsx‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ export function SubtaskStep({
115115
answered={result !== null && "answer" in result}
116116
count={count}
117117
handedBack={handedBack !== null}
118+
model={result && "model" in result ? result.model : undefined}
119+
bot={
120+
(result && "bot" in result ? result.bot : undefined) ??
121+
step.subtask?.bot
122+
}
118123
running={running}
119124
step={step}
120125
/>
@@ -184,27 +189,36 @@ export function SubtaskLiveLine({ step }: { step: StepDetails }) {
184189

185190
/**
186191
* How the subtask ended, beside its line. A finished one says only how many steps it took, and one
187-
* that answered without calling a tool says so: it did the work, so it never reads as no steps.
192+
* that answered without calling a tool says so: it did the work, so it never reads as no steps. One
193+
* the Bot gave a model of its own names that model first, as the model picker names it. One given to
194+
* another of the person's Bots names that Bot before anything else, while it works and after.
188195
*/
189196
function SubtaskStatus({
190197
step,
191198
running,
192199
handedBack,
193200
answered,
194201
count,
202+
model,
203+
bot,
195204
}: {
196205
step: StepDetails;
197206
running: boolean;
198207
handedBack: boolean;
199208
/** It finished with an answer. */
200209
answered: boolean;
201210
count: number;
211+
/** The model the Bot gave it, when not the conversation's. */
212+
model?: string | undefined;
213+
/** The other Bot it was given to, when not the asking Bot again. */
214+
bot?: string | undefined;
202215
}) {
203216
const steps = count > 0 ? `${count} ${count === 1 ? "step" : "steps"}` : "";
217+
const by = (said: string) => (bot ? `${bot} · ${said}` : said);
204218
if (running)
205219
return (
206220
<span className="shrink-0 text-muted-foreground">
207-
{steps ? `Working · ${steps}` : "Working"}
221+
{by(steps ? `Working · ${steps}` : "Working")}
208222
</span>
209223
);
210224
if (step.pending)
@@ -214,10 +228,16 @@ function SubtaskStatus({
214228
if (step.refused)
215229
return <span className="shrink-0 text-destructive">Blocked</span>;
216230
if (handedBack)
217-
return <span className="shrink-0 text-muted-foreground">Handed back</span>;
231+
return (
232+
<span className="shrink-0 text-muted-foreground">
233+
{by("Handed back")}
234+
</span>
235+
);
218236
if (step.failed)
219237
return <span className="shrink-0 text-warning">Didn't finish</span>;
220-
const said = steps || (answered ? ANSWERED_DIRECTLY : "");
238+
const said = [bot, model, steps || (answered ? ANSWERED_DIRECTLY : "")]
239+
.filter(Boolean)
240+
.join(" · ");
221241
return said ? (
222242
<span className="shrink-0 text-muted-foreground">{said}</span>
223243
) : null;

‎app/src/components/channels/tool-activity.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ export type StepDetails = {
445445
task?: string;
446446
/** Null while it works, after a turn that stopped before it answered, or when it was refused. */
447447
result: SubagentResult | null;
448+
/** Another of the person's Bots it was given to, by name, as the call named it. */
449+
bot?: string;
448450
};
449451
};
450452

@@ -831,6 +833,9 @@ function subtaskDetails(
831833
toolCallId: step.toolCall.id,
832834
...(task ? { task } : {}),
833835
result,
836+
...(typeof args.bot === "string" && args.bot.trim()
837+
? { bot: args.bot.trim() }
838+
: {}),
834839
},
835840
};
836841
}

‎app/tests/subtask-step.test.tsx‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,84 @@ test("a subtask that answered without calling a tool says it answered directly,
223223
}
224224
});
225225

226+
/*
227+
* A subtask the Bot gave a model of its own names that model on its line, as the model picker names
228+
* it, so the person sees the part they asked for on another model ran on it. One on the conversation's
229+
* model says nothing more than before.
230+
*/
231+
test("a subtask given a model of its own names that model on its line", async () => {
232+
const threadId = await subagentThreadId(
233+
answered.parentThreadId,
234+
answered.call.id,
235+
);
236+
const view = await draw(
237+
{
238+
...answered,
239+
result: JSON.stringify(
240+
JSON.stringify({
241+
answer: "Redesigned.",
242+
threadId,
243+
steps: 2,
244+
model: "Claude Opus 5.5",
245+
}),
246+
),
247+
},
248+
{ settled: true, busy: false },
249+
);
250+
await openWork(view);
251+
const line = within(
252+
(await view.findByText("Subtask")).closest("summary") as HTMLElement,
253+
);
254+
expect(line.getByText("Claude Opus 5.5 · 2 steps")).toBeTruthy();
255+
});
256+
257+
/*
258+
* A part given to another of the person's Bots names that Bot on its line, while it works (from the
259+
* call) and once it answered (from the result), so the person sees which Bot did it.
260+
*/
261+
test("a subtask given to another Bot names that Bot on its line, while it works and once done", async () => {
262+
const threadId = await subagentThreadId(
263+
answered.parentThreadId,
264+
answered.call.id,
265+
);
266+
const call = {
267+
...answered.call,
268+
args: JSON.stringify({
269+
...JSON.parse(answered.call.args),
270+
bot: "Designer",
271+
}),
272+
};
273+
const working = await draw(
274+
{ ...answered, call },
275+
{ settled: false, busy: true },
276+
answered.subagent.slice(0, 2),
277+
);
278+
const row = await subtaskRow(working);
279+
expect(await row.findByText("Designer · Working · 2 steps")).toBeTruthy();
280+
cleanup();
281+
282+
const done = await draw(
283+
{
284+
...answered,
285+
call,
286+
result: JSON.stringify(
287+
JSON.stringify({
288+
answer: "Redesigned.",
289+
threadId,
290+
steps: 2,
291+
bot: "Designer",
292+
}),
293+
),
294+
},
295+
{ settled: true, busy: false },
296+
);
297+
await openWork(done);
298+
const line = within(
299+
(await done.findByText("Subtask")).closest("summary") as HTMLElement,
300+
);
301+
expect(line.getByText("Designer · 2 steps")).toBeTruthy();
302+
});
303+
226304
test("while it works, the line says so, and the row opens to each step as the subagent takes it", async () => {
227305
// Its first step only: the subagent has asked for the account and the tickets, and nothing is back.
228306
const view = await draw(answered, { settled: false, busy: true }, [

‎docs/configuration.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,12 @@ next one is refused and the Bot is told to do the rest of the work itself. `BOT_
10511051
refuses every one. Both are refused at start-up if they are not whole numbers, and
10521052
`BOT_SUBAGENTS_AT_ONCE` must be at least `1`, because nothing would ever run.
10531053

1054+
A subagent runs on its conversation's model and thinking level. A Bot can give one another model,
1055+
from the models of the AI connections the person's runs can use now, as the model picker offers them
1056+
(an admin's allowed models apply). A model that isn't connected starts nothing, and the Bot is told
1057+
which ones are. A Bot at its own address given a model runs that subagent on OpenBot's own runner,
1058+
as that Bot, since the model at its address isn't OpenBot's to choose. Nothing here needs setting.
1059+
10541060
## Slack and Microsoft Teams (OpenTag pairing)
10551061

10561062
OpenBot reaches people in Slack and Teams through [OpenTag](https://github.com/CopilotKit/OpenTag),

0 commit comments

Comments
 (0)