Repository navigation
Description
Summary
A locally built binary can reach the client but never the daemon, and nothing in the tree can move it there.
The daemon resolves its reload and spawn target from the shared-server channel:
spawn_server(src/cli/dispatch.rs:1296) ->build::shared_server_update_candidate(...)reload_exec_target(crates/jcode-app-core/src/server/util.rs:102) ->newest_reload_candidate-> same
shared_server_update_candidate (crates/jcode-build-support/src/paths.rs:541) tries shared-server, then stable, then current_exe(). It never consults current.
But publish_local_current_build_for_source (crates/jcode-build-support/src/lib.rs:679), which is what self-dev --build calls, only moves current and the launcher:
let current_link = update_current_symlink(&source.version_label)?;
let launcher_link = update_launcher_symlink_to_current()?;And the two functions that could advance the daemon's channel both decline in this case:
advance_shared_server_if_tracking_stableis only called from the update path.repair_stale_shared_server_channeldragsshared-serverto stable, and returnsAlreadyCurrentwhen the existing marker is not a release marker.
So after self-dev --build the client runs the new binary and the daemon keeps the old one indefinitely.
What that looks like
On this machine the client was on v0.75.8-dev while the server had been serving v0.65.0 since Aug 4, ten releases apart, over the same socket. Both of these are correct-but-useless:
$ jcode server reload --json
{"reloaded": false, "already_current": true,
"detail": "jcode server is already running the newest binary; no reload needed."}
$ jcode server reload --force # re-execs the SAME old binary
$ jcode selfdev status
Running: jcode v0.65.0 (d847d62e4)
Current: ee3b3f4a5
Shared server: 0.65.0
reload is truthful: relative to its own candidate (the stale channel) the daemon is current. --force bypasses server_has_newer_binary but still resolves the same candidate, so it cannot help either.
There is already an API for this, with no caller
/// Promote an already installed immutable version onto the shared server channel.
pub fn promote_version_to_shared_server(version: &str) -> Result<Option<String>> {crates/jcode-build-support/src/lib.rs:726, re-exported through jcode-app-core/src/build.rs:14. grep -rn 'promote_version_to_shared_server(' matches only the definition and the re-export.
Suggested fix
Wire it to a command. I have this working locally as jcode server promote [VERSION] [--json], defaulting to whatever current points at:
$ jcode server promote --json
{
"version": "ee3b3f4a5",
"previous": "0.65.0",
"binary": ".../builds/versions/ee3b3f4a5/jcode.exe",
"promoted": true,
"detail": "shared-server channel 0.65.0 -> ee3b3f4a5. Run `jcode server reload` to apply it ..."
}
$ jcode server reload --force
$ jcode selfdev status
Running: jcode v0.75.8-dev (ee3b3f4a5)
Kept as a separate step from reload rather than folded into it, since the pin exists precisely so an update never silently wipes out a self-dev build; promoting is the decision that pin protects. It reports previous so the move is reversible, refuses a version that is not installed (a dangling channel symlink would send the next server spawn down a silent fallback), and is idempotent.
An alternative worth considering: have self-dev --build offer to promote, or teach server reload to report why it considers itself current (naming the channel and version it resolved), so the state is at least discoverable. The current message actively misleads.
Environment
Windows 11 x86_64, jcode built from source at v0.75.5 + local commits. Same machine as #912 and #914; this is the third link in the same chain: the updater would not update (#912), self-dev could not build (#914), and even after building, the daemon could not be moved (this one).
Activity
YalmutairiAisc commentedon Aug 12, 2026
Patch against
master(rebased onto 994b8d3, v0.75.5) - jcode server promote. Applies clean withgit am:dea37bb67 - jcode server promote
1jehuang commentedon Aug 13, 2026
I added
jcode server promote [VERSION] [--json], defaulting tocurrent, with installed-version validation, previous-version reporting, and idempotent behavior. Fix: #918.--- — Jcode agent (automated triage), on behalf of @1jehuang
fix: repair self-dev build promotion paths (fixes 1jehuang#914, fixes 1…
chore: sync fork with upstream jcode (fresh merge onto current master) (
chore: sync with upstream (#53)
fix: repair self-dev build promotion paths (fixes 1jehuang#914, fixes 1…
fix: repair self-dev build promotion paths (fixes 1jehuang#914, fixes 1…
fix: repair self-dev build promotion paths (fixes 1jehuang#914, fixes 1…
fix: repair self-dev build promotion paths (fixes 1jehuang#914, fixes 1…
fix: repair self-dev build promotion paths (fixes 1jehuang#914, fixes 1…
fix: repair self-dev build promotion paths (fixes 1jehuang#914, fixes 1…