Skip to content

Put uv on the agent's PATH so the documented commands run in CI - #91

Closed
leaf-agent wants to merge 1 commit into
mainfrom
fix/uv-on-agent-path
Closed

leaf-agent wants to merge 1 commit into
mainfrom
fix/uv-on-agent-path

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Problem

.config/tend.yaml says "setup-uv is where the agent gets uv", but it isn't. astral-sh/setup-uv publishes uv by appending its toolcache directory to $GITHUB_PATH, and the agent's sandbox PATH does not inherit that — it carries /usr/local/bin, /usr/bin, /bin, and the tend plugin directories, and nothing under /opt/hostedtoolcache. So inside every tend session on this repo:

$ command -v uv
uv: NOT on PATH

That is the whole documented interface to this repository. CLAUDE.md gives the suite as uv run pytest tests; every command in tests/CLAUDE.md is a uv invocation; and bin/leaf is a PEP 723 script that resolves its own dependencies through uv, so the CLI a session is editing cannot be driven either. A run could neither test its fix nor reproduce a bug through the product. What sessions have been reaching for instead is .venv/bin/python -m pytest, which happens to work for tests because uv sync --frozen warms .venv, and silently does not for anything else.

Fix

One setup step, linking the uv that setup-uv just installed into /usr/local/bin, which is on the sandbox's PATH:

- run: ln -sf "$(command -v uv)" /usr/local/bin/uv

A link rather than a sandbox_path: entry pointing at the toolcache, because that path carries uv's version (/opt/hostedtoolcache/uv/0.12.7/x86_64) and this action is deliberately unpinned — a version written into the config would come apart on the next uv release, silently and in exactly the way this is fixing. uvx is not linked; nothing in the repo uses it.

The generated workflows carry the setup: steps inline, so they are regenerated here — pinned at the stamped 0.1.19 so the diff is this step and nothing else. tend 0.1.20 is out; that bump belongs to its own regeneration PR.

Verification

On this run's runner, with the link in place, the documented command works as written:

$ uv --version
uv 0.12.7 (x86_64-unknown-linux-gnu)
$ uv run pytest tests --collect-only -q
654/1370 tests collected (716 deselected) in 3.34s

pre-commit passes on every changed file, actionlint included. No regression test: the failure is in CI job configuration, which the suite has no boundary over — tests/ covers the file, CLI, browser, and published-site boundaries, and nothing there reads .config/tend.yaml or the generated workflows. The next tend session on main is the check: it either has uv or it doesn't.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Withdrawing this — the premise is right but the remedy is wrong, and I found that out one step later in the same run.

tend 0.1.20 fixes this upstream: max-sixty/tend#1071 preserves setup-added tool paths in the sandbox, having diagnosed the same thing from the other side ("v0.1.19 erased the toolcache path before constructing AGENT_PATH"). #92 bumps this repo's workflows to it. So the symlink here would be a permanent step in .config/tend.yaml working around a bug that no longer exists — the shape of thing that outlives its reason and then confuses whoever reads it next.

The diagnosis in the description above still holds and is worth keeping: command -v uv finds nothing inside a session on the 0.1.19 action, which is why sessions have been reaching for .venv/bin/python -m pytest instead of the documented uv run pytest tests. #92 is the fix; if it lands and uv is still missing, this branch is the fallback.

Leaving the branch in place rather than deleting it.

@leaf-agent leaf-agent closed this Aug 28, 2026
max-sixty added a commit that referenced this pull request Oct 14, 2026
Closes Lit follow-up item #91, "a page thread's reply box moves after a
send".

## Behaviour that changed

A send from a thread's reply box in the page's flow (on a widget's
thread seat or a diff line) now keeps the box's foot, where Send and the
caret are, on the reading band's foot. It stays there through the send
that makes the thread taller than the band. A box with room below still
moves down by the turn it adds, as before. Escape from a box onto a
thread the user can see no longer moves it.

Before this, in Chromium and WebKit, the first send lifted the box 9px
on a seated thread and 13–14px on a diff thread. The send that made the
thread too tall dropped it back by the same amount. That breaks
Stability in `skills/leaf/assets/AGENTS.md`: "A state change may repaint
any box but must not move controls next to the gesture that caused it".
It also breaks the append-region allowance, which lets the idle reply
row move only by the transcript's growth, while here the box moved
against it.

## Cause

Two landings aimed at different lines:

- Typing brings the reply row's foot to the band's foot
(`revealWritingArea`).
- The send focuses the thread (`landSent`), and the focused thread asks
`--focus-ring-room` of scroll margin. While the thread fitted, the send
landed the whole thread nearest, so the box rose by the ring room plus
the thread's padding under the row. `standOnThread` made the same
landing before the turn drew.
- Once the thread no longer fitted, the landing aimed at the reply row,
which put the row's foot back on the band's foot.

The shift watch missed it because it measures in layout coordinates,
which remove scrolling (`tests/shift_watch.js`, "Scope"). Both moves
were scripted scrolls inside the send gesture's own rendering.

## Change

- `sendLanding` (`thread/reply-landing.js`) reads the reply row's foot
before the send draws. `replies.js` now takes that reading before
`sendReply`.
- After the turn draws, a row the user saw whole in flow goes down by
what the turn adds, less what the emptied box gives back. It stops where
its foot meets the band's foot, the same line typing uses.
  - A foot that was already past that line stays where it stood.
- A pinned row, a separate transcript, or a box out of view still lands
the thread as before.
- `holdBox` and the send share one hold (`standingAt`/`returnTo`). It
reads through `aimedTop` and moves through `moveScrollerBy`, so repeated
holds add no rounding.
- `standOnThread` no longer scrolls a thread the user already sees.
- `skills/leaf/assets/AGENTS.md`, Stability, gets a sentence on which
rule wins when a sent turn is taller than the room below the box: the
row stops at the band's foot and the scroller takes the rest. The
append-region text alone didn't settle it.

## Line deltas

- Hand-written source: +77 / −30 (net +47), mostly module comments.
- Tests: +122 / −4 (net +118).

## Tests

- `test_sends_from_a_page_threads_box_hold_its_foot_at_the_bands` covers
a seated thread with one-line replies and a diff thread with one-line
and four-line replies, in Chromium and WebKit. It fails with main's
runtime on the first send, by 9, 13 and 14px.
- `test_a_panel_send_with_room_below_moves_only_the_box` checks that a
Threads panel card with room below keeps the list still and moves the
box by the turn.
- I ran these focused selections, and they pass:
- send, Escape, seat, margin, held-send, paste-growth, landing and
panel-reply tests in `test_render_threads`, `test_render_margin`,
`test_render_drafts`, `test_render_floating_panel` and
`test_render_navigation`;
  - `test_chrome_contracts`;
  - `pnpm run test:runtime`.
- `test_a_rewrite_is_the_reply_box_where_the_words_stood[card]` fails
both with and without this change (main's runtime, f281604).

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 16, 2026
A thread or reply route the Leaf panel declined, because the thread is about a
passage, fell through the page's own drawings (margin card, held seat,
preview) to the banner's Threads panel (`showThread`), and a message route
went there directly. On a page whose threads the margin doesn't draw, `m` and
`t` opened that hidden-chrome panel (#91).

The destination now asks the primary reader again with `request.last` once
nothing on the page shows the thread, and the panel takes any thread then; it
also takes a message route of a thread about a passage, since only Leaf's
reader draws a message whole. A package reader that declines twice leaves the
thread unopened. The destination no longer knows the Threads panel
(`showThread`, `panelIsOpen` go), and module-annotations.md says the new
`reveal` contract. On the page stays out of a thread the panel holds as the
last resort, where it would only reopen the same view.

Tests: `m`/`t` on a page drawing no margin, and a card's "Open interactive
reply", now open the panel's thread view with the banner's surfaces shut.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 19, 2026
…3100)

Removes Leaf's classic chrome — the banner, the bottom shortcut bar and
status, the All pages and On drawers, and the Threads side panel — so
the floating panel is Leaf's only chrome. The user asked for this: "we'd
like to remove the banner. it's useful as reference code, but we don't
need to support users switching to it … move all our core to the
floating panel". Git history keeps the old code.

Size: 436 files, +15.9k / −54.6k. Runtime and styles −14.3k/+2.8k; tests
−30.0k/+8.0k; generated kernel and vendor −8.1k/+2.4k.

## What changes

- **No switch.** `chrome-choice.js`, `?lf-chrome`, a sample's `chrome`
attribute and the classic CSS reservations go; the reader's one stored
preference is the panel's fold.
- **Every route opens the panel.** A thread nothing on the page shows
(and message landings, #91's `m`) opens in the panel's thread view; All
pages is a panel view; `g T/M/L/V`, page-mode comments on selected
words, sample hosts and restore no longer reach the old surfaces.
- **The old surfaces are deleted.** What the panel used moved to modules
named for what they do: `page-status.js` (status, tab icon, approval),
`page-controls.js` (the menu's rows, whose press runs the command),
`page-about.js`, `keyboard/status-context.js` (walk position, Go-to
word), `page-layout.js`. `t` walks threads from the thread model; `?` is
a page command. Theme tokens are `--lf-head-room`, `--lf-foot-room`,
`--lf-z-panel`. The render gate waits for the panel (`no-runtime`) and
opens threads holding markup so reply widgets are checked.
- **Bugs fixed on the way** (each with a test that fails without it),
among them: a comment sent before the first state now shows; a refused
first comment gives its words back; reacting in the panel no longer
throws; a live sample in a thread sizes; nothing in the panel moves
without input when news arrives; the status placeholder and menu status
meet AA contrast; panel controls meet the aim floor under a finger; a
touch route to Select element; a Web Awesome patch stops a node per menu
opening; a SnapDOM patch fixes sample capture's CORS; the hidden side
panel no longer duplicates every thread's DOM; a thread on a widget an
agent sent stands in the message that carries it (the head's **In its
message** opens that message's thread and lands on the widget) instead
of reading as detached; a repaint no longer pulls focus off where the
user put it; the render gate reads unreachable words per opened thread;
Keyboard shortcuts from the leaf's menu opens the reference from where
the reader stood, so a code block's commands act there; the fold button
no longer rides the box across the window when a view opens and closes
under a still pointer; the panel's thread quote follows a datum's
relabel; a caret whose words a revision shortened returns at the end of
what is left rather than being dropped; "Waiting for the server to
finish updating" is a held error while it lasts, so the panel's field
says it. A refused reply keeps the panel thread's head where it stood, a
press on an error's cover stays inside the reply it covers, and a held
error is replaced in one reading so the leaf's dot doesn't blink.
- **Errors.** With no banner, `raiseError` (errors.js) always has the
panel to present it, so its notice fallback goes, and tests that
expected a refusal's notice now read the panel's error: in the field,
covering words it returned, or in Errors in the leaf's menu.
`page-status.js` holds the error for a status that reaches nothing
(offline, key refused, a reading that couldn't apply), which `main` held
in `banner.js`, and a refused approval raises its reason as an error.
- **Tools, tests and docs.** The `leaf-dev` tools (stills, bench, demo,
journeys, verify-site) drive the panel; the suite is ported (tests whose
subject was an old surface are deleted, each commit naming what lost a
test); the suite refuses an async predicate to `wait_for_function`,
which Playwright reads as a truthy promise and never waits on (the waits
that did are fixed); shipped references, glossary, site docs, examples'
prose, CLI help and notes describe the panel.

## Review notes

- Page-mode comments on selected words stand in the field's place in the
row; a page package's reader that declines a thread twice leaves it
unopened.
- The field's status rose from 48% to 62% ink (AA); muted words 72%, the
asks colour 84%.
- Block samples keep the panel row's room (~76px).
- Behaviour the old chrome had and the panel lacks is listed for the
user to choose on the review page; none of it is built here.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant