Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .claude/skills/codetrial-review/rules/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ has a 30 s default without Playwright Test.
Applies to: `tests/**`, `scripts/test.sh`, `scripts/browser-check.cjs`,
`tests/golden/**`

CI installs only headless Chromium (`test_every_browser_launch_is_headless`
rejects `channel:`). Linux Chromium reports a collapsed caret direction as
CI defaults to the headless shell. The native-capture example-board fixture
uses `channel: "chromium"`; its browser lane installs full Chromium explicitly.
`test_every_browser_launch_is_headless` rejects other channel launches. Linux
Chromium reports a collapsed caret direction as
`forward`, unlike macOS. `Instant::now() - 15 min` panics on a young CI
container (use `past_the_coding_round`). Java tests must probe both `javac` and
`java`. Compile-and-run cases belong in `describe(..., { concurrency: true })`.
Expand Down
45 changes: 36 additions & 9 deletions .github/actions/chromium/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ description: Restore Playwright's Chromium and install the system libraries it l
# and re-downloaded a browser nothing had changed. Needs `npm ci` first, since
# it reads that file and runs that playwright.
#
# The headless shell only. Every launch here is headless with no `channel`,
# which is the shell's job, so the full browser beside it was half of every
# download and of the cache entry restored on every run, for a binary nothing
# started. A headed launch would fail at once naming the missing executable.
# Most lanes need only the headless shell. Browser interaction tests can opt
# into the full browser for native pointer capture in Chromium's new headless
# mode. Separate cache keys keep a shell-only hit from hiding that binary.
# Shell lanes can restore the full entry, which includes the shell and is
# saved by the browser lane, instead of downloading it on every shell run.
#
# The system libraries are not in the cached directory, and installing them
# was most of this step's cost: `--with-deps` runs `apt-get update` and an
Expand All @@ -25,6 +26,10 @@ description: Restore Playwright's Chromium and install the system libraries it l
# one behind a ten-minute install. The launch afterwards is still required:
# the suites would fail on a browser that cannot start too, but minutes later
# and inside a test's output, where this fails at the step that caused it.
inputs:
full-browser:
description: Install full Chromium for native browser interaction tests.
default: "false"
outputs:
key:
description: The exact key, for the step that saves the browser.
Expand All @@ -39,10 +44,17 @@ runs:
uses: actions/cache/restore@v6
with:
path: ~/.cache/ms-playwright
key: playwright-shell-${{ runner.os }}-${{ hashFiles('node_modules/playwright-core/browsers.json') }}
key: playwright-${{ inputs.full-browser == 'true' && 'full' || 'shell' }}-${{ runner.os }}-${{ hashFiles('node_modules/playwright-core/browsers.json') }}
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
Comment thread
Chuyutseng marked this conversation as resolved.
Resolved
restore-keys: playwright-full-${{ runner.os }}-${{ hashFiles('node_modules/playwright-core/browsers.json') }}
- shell: bash
env:
CHROMIUM_FULL_BROWSER: ${{ inputs.full-browser }}
run: |
npx playwright install --only-shell chromium
case "${CHROMIUM_FULL_BROWSER:-false}" in
true) npx playwright install chromium ;;
false) npx playwright install --only-shell chromium ;;
*) echo "full-browser must be true or false" >&2; exit 1 ;;
esac
# The shell and the libraries it opens at run time, ANGLE and
# SwiftShader among them, which a launch alone never loads. No shell
# found is a failure, not a pass: a renamed executable would otherwise
Expand All @@ -51,10 +63,25 @@ runs:
shell=(-name chrome-headless-shell -o -name headless_shell)
[ -n "$(find "$cache" -type f \( "${shell[@]}" \))" ] \
|| { echo "no headless shell under $cache" >&2; exit 1; }
missing=$(find "$cache" -type f \( "${shell[@]}" -o -name '*.so' \) \
if [ "${CHROMIUM_FULL_BROWSER:-false}" = true ]; then
[ -n "$(find "$cache" -type f -name chrome)" ] \
|| { echo "no full Chromium under $cache" >&2; exit 1; }
fi
missing=$(find "$cache" -type f \( "${shell[@]}" -o -name chrome -o -name '*.so' \) \
-exec ldd {} + 2>/dev/null | grep -F 'not found' | sort -u || true)
if [ -n "$missing" ]; then
printf 'Chromium is missing system libraries:\n%s\n' "$missing"
timeout 15m npx playwright install-deps chromium-headless-shell
if [ "${CHROMIUM_FULL_BROWSER:-false}" = true ]; then
timeout 15m npx playwright install-deps chromium
else
timeout 15m npx playwright install-deps chromium-headless-shell
fi
fi
node -e "require('playwright').chromium.launch().then((b) => b.close())"
node <<'JS'
const { chromium } = require('playwright');
(async () => {
await (await chromium.launch()).close();
if (process.env.CHROMIUM_FULL_BROWSER === 'true')
await (await chromium.launch({ channel: 'chromium' })).close();
})().catch((error) => { console.error(error); process.exitCode = 1; });
JS
2 changes: 2 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ jobs:
if: matrix.lane != 'portable'
id: chromium
uses: ./.github/actions/chromium
with:
full-browser: ${{ matrix.lane == 'browser' }}

- name: Place the instructor packaging environment
if: matrix.lane == 'portable'
Expand Down
18 changes: 10 additions & 8 deletions docs/provider-cost-and-degradation.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,16 @@ Coding example drawings are opt-in in the lobby and disabled by default.
The choice is carried in signed token metadata and applies to the Live tool
declarations, instructions, interim and final report policy, and board stream
acceptance. Disabled coding sessions carry none of that drawing prompt or tool
overhead and refuse board streams. The first version offers pen, eraser, undo and clear. Shapes and redo are not
part of this version. The browser syncs JPEGs to the server's bounded board
cache; these local edits do not enter Gemini Live. Coding camera frames keep
the presence policy above. Only a `read_board` call sends the latest example
JPEG through realtime image input before its JSON tool response. The interviewer
calls it when the candidate refers to the drawing, never for an unreferenced
sketch. Changes, drawing handovers and reconnects send zero example images to
Gemini; each tool batch requesting a drawing sends at most one current JPEG.
overhead and refuse board streams. The drawing offers pen, eraser, text labels,
line, rectangle and ellipse tools, undo and clear. Each completed shape is one
ordinary stroke. Redo is not offered. The browser syncs JPEGs to the server's
bounded board cache; these local edits do not enter Gemini Live. Coding camera
frames keep the presence policy above. Only a `read_board` call sends the latest
example JPEG through realtime image input before its JSON tool response. The
interviewer calls it when the candidate refers to the drawing, never for an
unreferenced sketch. Changes, drawing handovers and reconnects send zero example
images to Gemini; each tool batch requesting a drawing sends at most one current
JPEG.
A read waits at most 100 ms for pending local streams. Offline browsers retain
edits without repeated JPEG encoding and sync them on reconnect. After an
explicit read, the image remains in the live context and is billed on later
Expand Down
9 changes: 6 additions & 3 deletions docs/task-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,12 @@ turn tables. Turning is the learner's own; nothing the cube does is sent to
the runtime, Jim or the review.

A whiteboard below the editor is the interview's example drawing: pens, an
eraser, undo and clear. What is drawn on it leaves the browser only as the
`board_image` stream described under the wire protocol, and the interviewer
sees it only when the learner refers to it.
eraser, text labels, line, rectangle and ellipse tools, undo and clear.
Shapes preview while dragging and commit on release as one ordinary stroke,
so they share the pen's color, undo, replay and reconnection paths. What is
drawn on it leaves the browser only as the `board_image` stream described
under the wire protocol, and the interviewer sees it only when the learner
refers to it.

## Runtime and delivery bounds

Expand Down
Loading
Loading