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(core): include a running tool's progress metadata when reading messages by jlongster · Pull Request #64929 · anomalyco/opencode

Conversation

@jlongster

@jlongster jlongster commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

A running tool call's progress metadata (context.progress) only reaches clients through the ephemeral session.tool.progress event; the saved part gets metadata when the call settles. So a client that opens or reloads a session mid-call reads metadata: {} from GET /api/session/:id/message and misses e.g. a foreground execute's background/toolCalls (no Ctrl+B offer, inner shells shown as background shells) or a running subagent's sessionID.

The LLM event publisher now also records the latest progress in a small process-local map (session/runner/live-tool-metadata.ts), cleared when the call settles or fails. SessionStore message reads (messages, messagesWithRefs, message, messageWithRefs) overlay it onto tool parts that are still running. No new durable events or DB writes; settled parts are untouched.

How did you verify your code works?

  • New unit test packages/core/test/session-live-tool-metadata.test.ts; bun run typecheck:tsc in core.
  • Against a live isolated opencode serve (simulated LLM): a foreground execute running tools.shell now reads back as {"status":"running","metadata":{"toolCalls":[{"tool":"shell","status":"running",...}],"background":true}} (was {}).
  • A model-based test of the background pill (tear) that pinned this as a known failure now passes when the app is held to spec: a freshly opened client offers the running script to the background.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

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

All reactions
@jlongster
fix(core): include a running tool's progress metadata when reading me…
418f1b2
…ssages

User decisions:
- Fix reloads losing a running tool's progress metadata (F1) by overlaying it on message reads
@github-actions github-actions Bot added the contributor label Nov 19, 2026
@jlongster
fix(core): follow the import and formatting rules
d9d3b1f
User decisions:
- Address review issues on the F1 fix
@jlongster
jlongster enabled auto-merge (squash) November 19, 2026 18:09
@jlongster
jlongster disabled auto-merge November 19, 2026 18:09
@jlongster
jlongster enabled auto-merge (squash) November 19, 2026 18:10
opencodejr[bot]
opencodejr Bot reviewed Nov 19, 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 fix works and I found nothing that blocks it. I reproduced the problem on the base with opencode-drive and the simulated model: while an execute call running tools.shell("sleep 12") was still going, reading the session's messages returned metadata: {} for the running part. With this PR the same read returns { toolCalls: [{ tool: "shell", status: "running", … }], background: true }. The new test and the nearby store, execution and background tests pass, and typecheck:tsc in core is clean.

The map is cleared on every way a call settles (success, failure and bulk failure), and the overlay only touches parts that are still running, so settled parts are unchanged.

Public API: no endpoints, fields or events are added or removed. Message reads now return the same progress metadata for a running tool part that the session.tool.progress event already carries (backwards compatible).

Sorry, something went wrong.

Uh oh!

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

All reactions
opencodejr[bot]
opencodejr Bot reviewed Nov 19, 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 a refactor and doesn't change behaviour. The module now exports itself as LiveToolMetadata, overlay uses the real SessionMessage types instead of loose casts, and the test builds real SessionMessage.Assistant values. I re-ran the mid-call read with opencode-drive and the simulated model: the running execute part still comes back with its toolCalls and background metadata. The tests and typecheck:tsc in core pass. Public API: unchanged. No new concerns.

Sorry, something went wrong.

Uh oh!

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

All reactions
@jlongster
jlongster merged commit 9995279 into dev Nov 19, 2026
10 checks passed

Uh oh!

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

@jlongster
jlongster deleted the live-tool-metadata branch November 19, 2026 18:13
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

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

Assignees

No one assigned

Labels

contributor

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.

1 participant

@jlongster
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.