Files
paseo/packages/protocol
Mohamed Boudra cf9eaa8d29 Forge links use the daemon-resolved host and parent repository (#9576)
* fix(forge): build web links from the host and repository the daemon resolves

The app built forge links by parsing the origin remote itself, so an SSH
config alias (git@github.com-work:...) produced https://github.com-work/...
and a fork checkout sent #123 to the fork instead of the repository that owns
the numbers.

The daemon now publishes `forgeWeb` { host, referenceRepository? } on the
workspace descriptor and on checkout status, and the app builds every forge URL
from it. The host is the ssh -G resolved cloud host. referenceRepository is the
fork's parent, read through an optional ForgeService.getReferenceRepository
(GitHub, GitLab, Gitea family). Branch and file links stay on the origin
repository because a feature branch usually exists only on the fork.

Old daemons omit the field and the app derives links from the remote as before
(tagged COMPAT(forgeWeb)).

* fix(forge): keep the published web location tied to its remote and retry failed parent lookups

- A web location resolved for one origin remote is no longer published after
  `git remote set-url`; it returns when the next forge refresh resolves the new remote.
- The GitHub parent lookup rejects on a gh failure instead of returning null, so a
  network error is retried rather than cached as "this repository has no parent".
- The pull request status poll retries a due lookup, so an idle workspace recovers
  without waiting for a forced refresh.
- Workspace snapshot fixtures now expect `forgeWeb` for github.com remotes.

* fix(forge): look up a fork's parent once per remote, on any checkout

- A successful parent lookup is kept for the life of the remote instead of being repeated by every
  forced refresh (each push, fetch and branch switch).
- The lookup no longer waits on the pull request status's auth state, which is "no_remote" on a
  detached HEAD; a failed or signed-out lookup is retried on the next forced refresh or poll.

* fix(forge): resolve the new remote's web location when origin changes

`git remote set-url` reaches the daemon as a git-only refresh, which stopped publishing the old
remote's forgeWeb but never resolved the new one, so links fell back to parsing the remote.
A git refresh that finds the remote changed since the last forge refresh now runs a forced forge
refresh, which also probes a newly seen SSH alias.

* fix(forge): keep the alias-resolved host when a failed parent lookup is retried

The poll's retry resolved the forge with the synchronous resolver, which reports the raw SSH alias
as the host. A lookup that settled on retry then published and kept `github.com-work` as the web
host. The retry now uses the async resolver, like the forge refresh, so the host means the same
thing on both paths.

* fix(forge): treat a Gitea or GitLab API error body as a failed parent lookup

`tea api` exits 0 on HTTP errors, so an error body parsed as a repository without a parent and was
cached as "not a fork". The repository schemas now require the repository's own name, so an error
body rejects and the lookup is retried. The shorthand provider also keys its context on the
forgeWeb strings, so unrelated workspace updates no longer re-render every Markdown message.

* fix(forge): keep the parent lookup off the workspace refresh path

* fix(forge): keep a parent answer that lands during a refresh

* test(forge): make the parent lookup tests Windows-safe

* fix(forge): drain the background parent lookup on dispose

* test(forge): retry temp cleanup after the poll lookup on Windows
2026-11-13 19:59:42 +07:00
..
2026-05-28 01:58:18 +08:00

@getpaseo/protocol

Shared Paseo protocol schemas, codecs, and wire types.

Stability

This package is public so Paseo's published packages can depend on it cleanly. It is not a stable public API yet.

Schemas, exports, wire helpers, and types may change or disappear in any release without advance notice. Use it outside Paseo at your own risk until the package is explicitly documented as stable.