Skip to content

Take three upstream fixes, and write down the harness/upstream review - #18

Merged
polats merged 6 commits into
mainfrom
upstream-fixes-aug14
Aug 15, 2026
Merged

polats merged 6 commits into
mainfrom
upstream-fixes-aug14

Conversation

@polats

@polats polats commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Three upstream bug fixes worth taking regardless of strategy, plus the research doc behind the decision to keep tracking upstream.

The fixes

Cherry-picked in upstream order from alphaXiv/openresearch-cli:

f28055c Fix stale run cancellation recovery (alphaXiv#151)
a94c399 Queue chat messages sent mid-turn (alphaXiv#178) — kills the "session is busy — interrupt it first" error
2530c65 Handle retained provisioning failures (alphaXiv#176)

420 tests pass, cargo fmt --check and cargo clippy --all-targets clean, ui typechecks and builds, dist rebuilt.

Resolutions worth a look

  • commands/up.rs — the cancel handler keeps our play-session short-circuit but swaps the bare set_cancel_requested for upstream's request_local_run_cancel. That call is the actual fix: it locks, persists intent, respawns an orphaned supervisor, and rolls back on spawn failure.
  • commands/supervise.rs — upstream's terminal-status early return sits before our watcher-heartbeat task, so a supervisor respawned for a finished run exits instead of idling forever.
  • TreeView.tsx — adopted runDisplayStatus and the cancelling state; kept our game vocabulary (Idea/Building/Merge/Prototype) and dropped the run-squares row upstream re-added. One-line revert if you want the squares back.
  • ChatPanel.tsx — a94c399 is post-Tailwind-migration, so its queued-message chip arrived as utility classes that are dead strings in our build. Kept the semantic class names and wrote real CSS into styles.css.

Two upstream tests dropped

Both assert behaviour from commits we have not merged; they rode along only because git couldn't split the block:

  • remote_clone_fetches_recorded_commit_detached — asserts an hf_clone_script that fetches a recorded commit detached. f28055c never touched that function; ours still uses clone --depth 1 --branch. Taking the test would have meant silently taking an unrelated behavioural change.
  • project_json_exposes_artifacts_dir_with_legacy_alias — builds a LocalProject with github_sync_enabled, a field our struct doesn't have.

The doc

docs/harness-and-upstream-review.md records three questions asked together — unmerged upstream work, what adding Pi as a fourth harness would cost, and what DeepSeek Harness plus the Cordis paper have to teach us — and the answers, which are mostly "don't".

It also records the decision to keep tracking upstream, which makes the Tailwind port the next gating item: 8100bdf deletes the 6,162-line styles.css our brand lives in, and until we port, every upstream UI commit after 10 Aug needs hand-translation and ~15 stay out of reach.

Read-through from this batch: upstream commits do not arrive self-contained. Two of three carried call sites or assertions belonging to commits we skipped. Take whole tranches in upstream order rather than cherry-picking across gaps.

🤖 Generated with Claude Code

sox8502 and others added 6 commits August 14, 2026 17:40
…ring) (alphaXiv#178)

* Queue messages sent while a turn is running

Sending a chat message while a turn is in flight previously errored with
"session is busy — interrupt it first". Instead, park the message and run
it automatically when the current turn finishes — Claude-desktop-style
mid-run steering. Lives in ChatHost above the harnesses, so Claude, Codex,
and OpenCode are all covered.

Backend: a per-session in-memory queue on ChatHost; send_message enqueues
on a busy claim and emits chat.queued; a natural turn completion drains the
next message (FIFO); user Stop and session delete clear the queue; a new
DELETE .../queue/{itemId} cancels one parked message; the messages endpoint
returns the queued snapshot for reload recovery.

Frontend: send() parks instead of bailing while busy; queued messages render
as chips above the composer with a cancel ✕; chat.queued drives the reducer;
the seed snapshot restores chips after a reload.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Address review: drop vs re-park on drain failure, clear queue on project delete

- drain_queue re-parks a message only on a genuine busy-race (is_busy after
  the failed send); genuine setup errors and deleting sessions now drop+log
  instead of stranding a chip that re-fails on every future drain.
- delete_project clears each session's queue (parity with delete_session), so
  no parked entries orphan a deleted project.
- Image/file-only parked messages get an "N attachment(s)" chip label instead
  of a blank one.
- Import ordering + comment trims from review.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Coalesce queued messages into one turn

When several messages are parked behind a running turn, drain them all into a
single combined turn (texts joined by blank lines, attachments concatenated,
most-recent composer overrides win) instead of running a full turn per message
— so successive steering prompts run together as soon as the turn ends.

Re-park on a busy-race restores the individual messages (front, arrival order)
so they re-coalesce on the next drain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* fix: make compute supervision durable

* fix: supervise managed compute safely

* fix: defer compute failure handling to API

* fix: narrow provisioning failure contract
Records three questions asked together — what upstream work we haven't
merged, what adding Pi as a fourth harness would cost, and what DeepSeek
Harness and the Cordis paper have to teach us — and the answer, which is
mostly "don't".

The evidence is here so the question isn't re-opened from scratch, and so
the one live decision (keep tracking upstream, or hard-fork) gets made with
numbers attached: 48 unmerged commits, 55 conflicted files, and a Tailwind
migration that deletes the file our brand lives in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The picks were cut against a stale local main, before PR #17 landed the
splats work on origin. Rebased onto origin/main — no source conflicts, only
build artifacts — and rebuilt dist.

Also fixes the ahead-count in the review: the fork is 92 ahead of upstream,
not 50. The behind-count (50, of which 48 are genuinely new) was right, and
it is the one that matters — shipping our own work never moves it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
We keep merging from upstream/main rather than hard-forking. Their harness
layer is real engineering we'd otherwise maintain alone, and it is inherited
infrastructure — not the differentiator we want to spend solo-team time on.

The accepted cost is the Tailwind port plus a recurring merge tax, which
makes the port the next gating item: until it lands, every upstream UI
commit after 10 Aug needs its markup hand-translated and ~15 stay out of
reach.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@polats
polats merged commit 488f7b9 into main Aug 15, 2026
7 checks passed
@polats
polats deleted the upstream-fixes-aug14 branch August 15, 2026 03:19
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.

3 participants