GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(app): show a prompt sent while agents and models load in the timeline at once by Hona · Pull Request #62025 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Nov 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

If you press Enter while a Session's folder is still loading its agents and models, the prompt stayed in the composer behind a spinner on Send until the load finished. On a busy server that wait lasts seconds. Now the prompt leaves the composer at once and shows in the timeline as Pending. It is sent as soon as the agents and models load.

The recent state-machine series did not cause this. Pre-series dev (644d41f37a) holds the send the same way. A sweep against a real opencode serve compared pre-series, current dev and this branch: 12 server conditions (latency, a 3 s event stall, slow endpoints, server main thread 50% and 100% busy), 4 cases, 3 runs each. Current dev never shows a sent message later than pre-series. The held send is the only case where the message is not on screen within ~100 ms, and it behaves the same on both.

Before (dev, server main thread 100% busy):

before.mp4

After:

after.mp4

Time from Enter to the message in the timeline (median of 3 runs):

Case Server pre-series dev this PR
Session in a folder still loading idle 192 ms 188 ms 14 ms
400 ms per request 1.6 s 1.6 s 7 ms
2.5 s per request 10.0 s 10.1 s 6 ms
agent/model catalog +3 s 3.1 s 3.1 s 9 ms
main thread 100% busy 4.3 s 4.2 s 12 ms
Follow-up, loaded session 2.5 s per request 877 ms 887 ms 17 ms
Follow-up, loaded session every other condition 31–54 ms 36–46 ms 32–49 ms
New-session draft in a folder still loading main thread 100% busy 4.3 s 4.1 s 3.4 s (still held)

What changes

stateDiagram-v2
  [*] --> idle
  idle --> held: Enter, no agent or model yet
  note right of held
    shown (steer to a Session):
    timeline shows it as Pending,
    composer is cleared
  end note
  held --> preparing: hold.loaded with a selection
  held --> idle: Stop / unmount (prompt returns to the composer)
  held --> idle: loaded without a model (prompt returns, choose a model)
  preparing --> handing_off: session.started
  handing_off --> idle: handoff.ready
Loading
  • Composer submit machine (composer/machine.ts):
    • held now carries the captured snapshot and a shown field. A steer to an active Session (not a slash command, shell command or queued prompt) enters held with shown, and the transition emits hold.show.
    • hold.loaded carries the resolved selection and continues from the snapshot taken at Enter, with the same message ID.
    • preparing and handing-off carry cleared. The later composer.clear then never wipes a draft typed while the prompt waited, and history is recorded once.
  • Handoff machine (session/handoff-machine.ts): a new held phase. No request is in flight, so it starts no timer and ignores reconnects. The real send replaces it with sending under the same message ID, so the row does not remount.
  • Timeline:
    • A held prompt reports the sending pending status.
    • session-ui shows it like a waiting steer (faded, "Pending"), with no actions: there is no server row to move, delete, revert or fork yet.
    • A message with no model names none, instead of an empty label after a separator dot.
  • Unchanged holds: a slash command, shell command, queued prompt or new-session draft still waits in the composer, and editing it cancels it.
Event while a shown prompt is held Before After
Enter text stays in the composer, spinner on Send timeline shows it as Pending, composer clears
Typing cancels the send new draft, the send continues
Stop, leaving the Session, a load without a model, or a failed send, after typing a new draft (not possible: typing cancelled the send) prompt returns in front of the new draft, which keeps its comments
Stop / leaving the Session cancels, text stays cancels, prompt returns to the composer, row removed
Load ends without a model toast, text stays toast, prompt returns to the composer, row removed

Product calls

  • A second Enter while a prompt is held is ignored, as before. The new draft stays in the composer.
  • Leaving the Session while a prompt is held cancels it and returns it to that Session's composer, as before.
  • A held prompt that is cancelled after a new draft was typed, or fails once sent, goes back in front of that draft. Nothing typed is lost.
  • Once dispatched, a held prompt goes through the same latest-prompt status tracking as any other send (fix(app): settle quote sends with the composer submit #62037). While it waits, the Session's status is untouched.
  • Out of scope (decided): a new-session draft in a folder that is still loading still waits in the draft composer. The draft has no timeline until the Session exists, and creating the Session needs the agent and model.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none">
  <style>
    .t{animation:t 3.2s infinite}
    .b{animation:b 3.2s infinite}
    @keyframes t{0%,18%{opacity:1}24%,100%{opacity:0}}
    @keyframes b{0%,18%{opacity:0}26%,62%{opacity:.4}72%,94%{opacity:1}100%{opacity:0}}
    @media (prefers-reduced-motion:reduce){.t,.b{animation:none}.t{opacity:0}.b{opacity:.4}}
  </style>
  <rect x="8" y="48" width="224" height="18" rx="5" stroke="currentColor" stroke-opacity=".35"/>
  <rect class="t" x="18" y="55" width="96" height="4" rx="2" fill="currentColor" fill-opacity=".7"/>
  <g class="b">
    <rect x="120" y="10" width="110" height="20" rx="7" fill="currentColor" fill-opacity=".16"/>
    <rect x="130" y="18" width="80" height="4" rx="2" fill="currentColor"/>
    <rect x="186" y="34" width="44" height="4" rx="2" fill="currentColor" fill-opacity=".5"/>
  </g>
</svg>

This code runs once per send, not on a per-frame path, so there is no strobe benchmark.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona requested a review from Brendonovich as a code owner November 5, 2026 08:50
Copilot AI balanced review requested due to automatic review settings November 5, 2026 08:50
Copilot AI reviewed Nov 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencodejr[bot]
opencodejr Bot reviewed Nov 5, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks sound. A prompt to a Session sent while its Location loads now shows in the timeline as Pending at once, the composer clears, and it sends under the same message ID once the agents and models load. Holds that aren't shown keep the old behaviour. I checked it with the new browser test, which fails on the base for the three held-prompt cases and passes here, plus the composer, handoff and timeline unit tests and tsc -b for app and session-ui. I couldn't run the Playwright e2e test (no browsers here). The change is in the web app, not the TUI, so I have no screenshots.

Public API: unchanged. The new handoff.hold / held and the "sending" pending status are internal to packages/app and packages/session-ui.

One case worth handling: a cancelled shown hold can drop the prompt after the user has typed a new draft (see inline).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/app/src/composer/submit.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Hona
Hona force-pushed the optimistic-send branch from 5edf373 to c976231 Compare November 5, 2026 08:53
opencodejr[bot]
opencodejr Bot reviewed Nov 5, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This push rebases the change onto #62021. The adaptations to its retry fingerprints, restoreDraft and the removed setMode look correct, and the composer, handoff and timeline unit tests, the loading browser test and tsc -b for app and session-ui pass. Public API: unchanged.

The earlier point about a cancelled held prompt being dropped after a new draft is typed isn't addressed yet. Nothing new to raise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona force-pushed the optimistic-send branch from c976231 to 72f5707 Compare November 5, 2026 09:34
opencodejr[bot]
opencodejr Bot reviewed Nov 5, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit is correct: a held prompt, which has only an empty placeholder model, no longer shows an empty model label, and other callers are unaffected. The rest of the push is the same change rebased. tsc -b for session-ui, the loading browser test and the composer and handoff unit tests pass. Public API: unchanged.

The earlier point about a cancelled held prompt being dropped after a new draft is typed is still open.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Hona added 3 commits November 6, 2026 00:23
@Hona
fix(app): show a prompt sent while the session's agents and models lo…
77fd837
…ad in the timeline at once
@Hona
fix(session-ui): name no model on a prompt held before its catalog loads
bb6bc31
@Hona
fix(app): return a held prompt in front of a draft typed while it waited
fe5970c
@Hona
Hona force-pushed the optimistic-send branch from 72f5707 to fe5970c Compare November 5, 2026 14:29
opencodejr[bot]
opencodejr Bot reviewed Nov 5, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The earlier point is addressed: a held prompt cancelled by Stop, by leaving the Session or by a load without a model now comes back in front of a draft typed while it waited, and the new browser test cases cover it. The same applies when the send fails after the hold. Checked with the loading browser test (7 pass), the src/composer and src/session unit tests (760 pass) and tsc -b for app. Public API: unchanged. Nothing new to raise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona merged commit 6bd4719 into dev Nov 5, 2026
32 of 39 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Hona
Hona deleted the optimistic-send branch November 5, 2026 14:48
@Hona Hona mentioned this pull request Nov 5, 2026
fix(app): bound new-session start phases, fix brick breaker phase timing, and toast failed dialog loads #62117
Merged
@amrkmn amrkmn mentioned this pull request Nov 7, 2026
opencode 2.2.6 amrkmn/homebrew-tap#1217
Closed
1 task
This was referenced Nov 7, 2026
feat: opencode release v2.2.6 sprisa/opencode-server#84
Merged
Tool release: OpenCode 2 v2.2.6 (was v2.2.5) agent-sh/agnix#1808
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@opencodejr opencodejr[bot] opencodejr[bot] left review comments
@Brendonovich Brendonovich Awaiting requested review from Brendonovich

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Hona
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.