Repository navigation
fix(project): refresh renamed projects across live clients - #45043
Merged
Merged
Conversation
kitlangton
enabled auto-merge (squash)
August 25, 2026 20:00
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Keep connected OpenCode clients synchronized when a project is renamed or its repository directory moves. Existing TUI tabs update their project labels immediately, without restarting the TUI or reloading every project.
Before / After
Before: A project named
show-and-tellappears in an existing TUI tab. Renaming it tobeholdupdates the server's project record, butproject.updatedis excluded from the public event stream and the TUI retains the old cached metadata. Moving the repository also updates its canonical path without publishing any project change. Closing and reopening the tab does not help because the same client cache survives.After: Project metadata edits publish their existing
project.updatedevent to connected clients, repository moves publish the same event after updating the authoritative row, and the shared Solid client reconciles only the affected project. The open tab changes fromshow-and-telltobeholdimmediately. Project identity, sessions, custom names, and unrelated cached projects remain intact.How
packages/schema/src/event-manifest.ts: Promote the existing canonicalproject.updateddefinition into the public server-event manifest without duplicating it in the broader manifest.packages/core/src/project.ts: Detect canonical-directory changes during project resolution and publish the complete persisted project record after the existing upsert. Initial and unchanged resolutions remain silent.packages/client/src/solid/data.ts: Reconcile the updated project directly into the shared reactive project cache instead of refetching the complete project list.packages/client/src/promise/generated/types.ts: Regenerate the public event union to includeProjectUpdated.Scope
This change fixes live synchronization of existing project metadata and canonical directory changes. It does not alter project identity, add new project-management APIs, modify tab rendering, or address unrelated existing client API-group assertions.
Testing
bun turbo typecheck --concurrency=3passed across all 32 participating packages.packages/core:bun run test test/project.test.ts test/worktree.test.ts(36 passed, 1 existing skip).packages/schema:bun test test/event-manifest.test.ts test/legacy-event.test.ts(8 passed).packages/client:bun run test test/contract-identity.test.ts test/effect.test.ts test/import-boundaries.test.ts test/promise-service.test.ts test/service.test.ts test/solid-data.test.ts test/solid-pty.test.ts(43 passed).packages/client:bun run check:generated.bun typecheckpassed individually inpackages/core,packages/schema,packages/client,packages/protocol,packages/server,packages/tui, andpackages/app.origin/v2and this branch: the baseline retainsshow-and-tell; the fix updates the same open tab tobehold.packages/client/test/promise.test.tsalready fails on untouchedorigin/v2because its expected API groups omit the existingexperimentalgroup. That unrelated assertion is intentionally unchanged.Demo
Identical isolated TUI scenario on
origin/v2(left) and this branch (right). Both start withshow-and-tell; after the same project-name update, only the fixed client updates its existing tab tobehold.project-live-updates-before-after.mp4
Flow
sequenceDiagram participant Repository participant Core as Project Core participant Bus as Public Event Stream participant Client as Shared Solid Client participant TUI as Existing TUI Tab Repository->>Core: Resolve renamed canonical directory Core->>Core: Upsert existing project and preserve metadata Core->>Bus: Publish project.updated with complete Project.Info Bus->>Client: Deliver public project.updated event Client->>Client: Reconcile the affected cached project Client->>TUI: Reactively render the new project label