Skip to content

Add Codync as an ADE that opens in a terminal - #112

Open
leepokai wants to merge 4 commits into
InsForge:mainfrom
leepokai:add-codync
Open

leepokai wants to merge 4 commits into
InsForge:mainfrom
leepokai:add-codync

Conversation

@leepokai

@leepokai leepokai commented Dec 6, 2026 •

Copy link
Copy Markdown

What

Adds Codync as an ADE on macOS and Windows. Codync runs coding agents (Claude Code, Codex and others) as persistent bots you message from a phone, a desktop app or a terminal. Its host, codync-host, runs on the sandbox. Like Amp, nothing of Codync runs on this computer: InstaADE installs the host on the sandbox and opens Codync's terminal UI there in the user's terminal over SSH. No app here gets an SSH token.

  • Install Codync wakes the sandbox and runs one setup command. It reads the version of Codync's latest release from the release's codync-host-compat.json. When the sandbox has no codync-host, or one older than that release, it runs Codync's install script for that release (packaging/install.sh --host-only), which puts the host in ~/.local/bin, checks its SHA-256 and restarts a service that runs that file. A host as new as the release or newer (a dev build) stays, and so does any host when the version cannot be read. The setup then uses that one host (~/.local/bin, else the one on the PATH) for the service, codync-tui and the version it prints, and links it as /usr/local/bin/codync-host when nothing is there. It writes /usr/local/bin/codync-tui, since the SSH session runs one plain word, and turns on lingering.
  • With no codync-host service yet, codync-host install writes and starts a systemd user service from a login shell, so the service keeps the PATH where the agents are. With the service there, it only starts it, so Reconnect restarts bots at work only to update an older host.
  • Another user's Codync host can already hold port 19222 (a Codync cloud computer runs one as codync-agent). Then the service goes on the next free port, codync-tui reads the port from the service as systemd reports it, and the host counts as started only once it takes this user's token, not when anything answers on the port.
  • Reading the host's version stops after 10 s, the release's version after 20 s, the download after 60 s, the install script after 5 min, and the host must answer within 30 s. A failure shows the last 3 lines and one plain line, such as Codync's install script failed.
  • Then it prints codync-host --version. Without a version, the sandbox does not get codync in its mark.
  • Open in Codync opens the terminal with ssh -t instabox-<name> codync-tui. It runs no setup on the sandbox.
  • README, docs/ades.md, DEVELOPMENT.md and CONTRIBUTING.md list Codync as a Terminal ADE.

Install to Open

  1. Codync in the ADE switcher, as a Terminal ADE that needs only OpenSSH here.
  2. Connect on a paused sandbox with no ADE: InstaADE wakes it, then runs the setup (Installing Codync, then opening).
  3. Done: the sandbox runs, with Codync connected.
1. Switcher 2. Waking 2. Installing 3. Installed
01-ade-switcher 02a-waking-sandbox 02-install-codync 03-installed
  1. Open in Codync: Terminal runs ssh -t instabox-<name> codync-tui, and Codync's terminal UI on the sandbox shows its host's bot.
04-open-in-codync-tui

The title bar of the Terminal window is cut off: the SSH user there is the sandbox's SSH token. The account in the popover's footer is blacked out.

How I checked

In InstaADE built from this branch at 0b76dcb (bun tauri dev), before the last two commits, on macOS 27.0.1, signed in:

  • On a paused sandbox with no ADE connected, Connect in Codync mode showed Waking sandbox, then Installing Codync, then opening, then the sandbox running with Codync connected. It then opened Terminal with ssh -t … codync-tui.
  • On the sandbox after the setup: it had kept the codync-host 2.24.0 it already had in ~/.local/bin, which is why the setup now updates an older host. systemctl --user is-active codync-host printed active, the service ran codync-host serve --port 19222, and the terminal UI ran codync-host tui --port 19222.
  • Before Open, I updated the host on the sandbox to Codync's current dev build (2.58.1): the terminal UI in step 4 runs that build.
  • Open in Codync from the sandbox's menu opened Terminal again, and the terminal UI listed the sandbox's bot Codync, with no invalid token.
  • The last commit's version check and release parsing run in ade::codync::tests::setup_updates_only_a_host_older_than_the_release: 2.24.0 and 2.9.0 are older than 2.57.2 and 2.10.0; 2.57.2 and 2.58.1 are not older than 2.57.2. ade::codync::tests::the_terminal_ui_runs_the_setups_host_on_the_services_port runs codync-tui with a fake systemctl and host. sh -n and bash -n pass on the setup.
  • bun run typecheck, bun run test (247 passed).
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test: 986 passed. ade::paradev::tests::the_installed_paradev_cli_has_hosts_add fails on this Mac: it runs the Paradev CLI installed in /Applications, which this change does not touch.

Not verified

  • The last two commits on a sandbox: the update of an older host, the download, and a service that runs another file. The run above was before them, and that sandbox's host was already in ~/.local/bin.
  • The port move: nothing held 19222 on this sandbox.
  • Windows.

🤖 Generated with Claude Code


Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Adds Codync as a Terminal ADE, like Herdr and Amp: Codync's host runs on the sandbox, and Open in Codync opens its terminal UI in the user's terminal over SSH. Nothing of Codync runs on the computer, which needs only the OpenSSH client.

Behavior

  • Install Codync reads the latest release's version from codync-host-compat.json and installs or updates codync-host via Codync's install script, then runs it as a systemd user service with lingering and writes codync-tui for the SSH session.
  • The setup uses one host throughout (~/.local/bin or the PATH), for the service, codync-tui and the version print; a service that runs another file is installed again on its port, and any host at or after the release stays.
  • When another user's Codync host holds port 19222, the service moves to the next free port; codync-tui and the setup read the port from the service as systemd reports it (systemctl --user cat), and the host counts as started only once it takes this user's token.
  • Open in Codync runs ssh -t instabox-<name> codync-tui with no setup on the sandbox; reading the host's version stops after 10 s.
  • Adds the logo, switcher entry, preview fixtures and docs across the README, docs/ades.md, DEVELOPMENT.md and CONTRIBUTING.md.

Written for commit cca07ec. Summary will update on new commits.

View guided diff

leepokai and others added 3 commits December 5, 2026 15:55
Codync runs coding agents as persistent bots you message from a phone,
a desktop app or a terminal. Install Codync puts its host on the
sandbox with Codync's own install script, runs it as a systemd user
service with lingering, and Open in Codync opens Codync's terminal UI
there over SSH, like Amp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a sandbox that is also a Codync cloud computer, codync-agent's host owns
port 19222. The setup's host crash-looped on it, the health wait passed on the
other host, and codync-tui showed "invalid token". The setup now installs the
service on the next free port, codync-tui reads the port from the service, and
the host counts as started only once it takes this user's token.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The setup installed the host only when the sandbox had none, so a sandbox
with an old codync-host kept it: one test sandbox ran 2.24.0 while the
release was 2.57.2. It now reads the latest release's version from its
codync-host-compat.json and runs the install script for that release when
the host is missing or older. A newer host, such as a dev build, stays, and
so does any host when the version cannot be read. The link in
/usr/local/bin is made only when nothing is there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-06T15:11:24.243852Z eff3c05 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 issues found across 19 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src-tauri/src/ade/codync.rs">

<violation number="1" location="src-tauri/src/ade/codync.rs:68">
P2: This runs the install script from the `main` branch with no pinning or checksum, so any change to `main` runs on every sandbox during setup. Fetch a script tied to the resolved release version, or verify its checksum before running it.</violation>
</file>

<file name="docs/ades.md">

<violation number="1" location="docs/ades.md:328">
P2: The 20-second version-check limit in this Amp line is not in the code. `VERSION_SCRIPT` in `amp.rs` is `amp --version 2>/dev/null || true` with no timeout. Remove the clause, or add the timeout to the code.</violation>
</file>

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Re-trigger cubic

Comment thread README.md Resolved
have="${have##* }"
latest="$(curl -fsSL --max-time 20 https://github.com/leepokai/Codync/releases/latest/download/codync-host-compat.json 2>/dev/null | sed -n 's/.*"version" *: *"\([0-9][0-9A-Za-z.+-]*\)".*/\1/p' || true)"
if [ -z "$have" ] || { [ -n "$latest" ] && older "$have" "$latest"; }; then
if ! curl -fsSL --max-time 60 https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh -o "$tmp/install.sh"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This runs the install script from the main branch with no pinning or checksum, so any change to main runs on every sandbox during setup. Fetch a script tied to the resolved release version, or verify its checksum before running it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src-tauri/src/ade/codync.rs, line 68:

<comment>This runs the install script from the `main` branch with no pinning or checksum, so any change to `main` runs on every sandbox during setup. Fetch a script tied to the resolved release version, or verify its checksum before running it.</comment>

<file context>
@@ -0,0 +1,288 @@
+have="${have##* }"
+latest="$(curl -fsSL --max-time 20 https://github.com/leepokai/Codync/releases/latest/download/codync-host-compat.json 2>/dev/null | sed -n 's/.*"version" *: *"\([0-9][0-9A-Za-z.+-]*\)".*/\1/p' || true)"
+if [ -z "$have" ] || { [ -n "$latest" ] && older "$have" "$latest"; }; then
+  if ! curl -fsSL --max-time 60 https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh -o "$tmp/install.sh"; then
+    echo "Could not download Codync's install script." >&2
+    exit 1
</file context>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not changed. This is the installer Codync publishes in its README (curl -fsSL https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh | sh), and it matches how the other ADEs here run their vendor's install script without pinning (Amp's https://ampcode.com/install.sh, Rex's install.sh). The script installs the release this setup read (CODYNC_VERSION=v<latest>) and checks the host's SHA-256.

Comment thread docs/ades.md Outdated

- When an SSH command cannot find `amp`, the command runs Amp's install script, `https://ampcode.com/install.sh`. It puts the latest Amp in `~/.amp/bin/amp`, checks its SHA-256 and links it as `~/.local/bin/amp`. Amp is one binary and needs no Node.js. InstaADE runs the script with `~/.local/bin` on its PATH, so the script changes no shell profile. An SSH command's PATH has neither folder, so InstaADE links Amp as `/usr/local/bin/amp`. An Amp the sandbox already has stays as it is.
- The download stops after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which.
- The version check stops after 20 seconds, the download after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The 20-second version-check limit in this Amp line is not in the code. VERSION_SCRIPT in amp.rs is amp --version 2>/dev/null || true with no timeout. Remove the clause, or add the timeout to the code.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/ades.md, line 328:

<comment>The 20-second version-check limit in this Amp line is not in the code. `VERSION_SCRIPT` in `amp.rs` is `amp --version 2>/dev/null || true` with no timeout. Remove the clause, or add the timeout to the code.</comment>

<file context>
@@ -325,7 +325,7 @@ Amp is a coding agent whose CLI runs in a terminal. Like Herdr, it runs on the s
 
 - When an SSH command cannot find `amp`, the command runs Amp's install script, `https://ampcode.com/install.sh`. It puts the latest Amp in `~/.amp/bin/amp`, checks its SHA-256 and links it as `~/.local/bin/amp`. Amp is one binary and needs no Node.js. InstaADE runs the script with `~/.local/bin` on its PATH, so the script changes no shell profile. An SSH command's PATH has neither folder, so InstaADE links Amp as `/usr/local/bin/amp`. An Amp the sandbox already has stays as it is.
-- The download stops after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which.
+- The version check stops after 20 seconds, the download after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which.
 - Then it prints `amp --version`. When the command fails or prints no version, the sandbox does not get `amp` in its mark.
 
</file context>
Suggested change
- The version check stops after 20 seconds, the download after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which.
- The download stops after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Right, that was a slip in eff3c05: the replace meant for Codync's line also hit Amp's. Fixed in cca07ec: Amp's line is back as it was.

Comment thread src-tauri/src/ade/codync.rs Resolved
Comment thread docs/ades.md Resolved
Comment thread src-tauri/src/ade/codync.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eff3c05bea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +84 to +85
if [ -x "$HOME/.local/bin/codync-host" ] && [ ! -e /usr/local/bin/codync-host ]; then
sudo -n ln -sfn "$HOME/.local/bin/codync-host" /usr/local/bin/codync-host

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the selected host binary throughout setup and launch

When a sandbox already has an older executable at /usr/local/bin/codync-host (or a symlink to another installation), the updater writes the release to ~/.local/bin but this guard leaves the old executable on the SSH PATH. The generated codync-tui and final version check then resolve the old copy; an isolated run installed 2.57.2 yet successfully reported and launched 2.24.0. Subsequent Reconnects prefer the new local copy for have, so they skip updates while Open continues using the old host. Select one executable and consistently use it for the service, TUI and version checks without replacing an unrelated system copy.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in cca07ec. The setup picks one host, ~/.local/bin/codync-host or else the one on the PATH, and uses it for the service (installed again on its port when the unit runs another file), for codync-tui and for the version it prints. The /usr/local/bin link is still made only when nothing is there, so another copy is never replaced.

After an update to ~/.local/bin, an older codync-host earlier on the
PATH kept running the service, the terminal UI and the version check.
The setup now picks one host, the one in ~/.local/bin or else the one on
the PATH, and uses it for all three; a service that runs another file is
installed again on its port. codync-tui and the setup read the service's
port from `systemctl --user cat`, so a custom XDG_CONFIG_HOME no longer
hides it, and reading the host's version stops after 10 s.

The docs say the setup updates an older host, and README says an idle
sandbox can sleep and pause the bots. Amp's timeouts line, changed by
mistake in the last commit, is as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src-tauri/src/ade/codync.rs">

<violation number="1" location="src-tauri/src/ade/codync.rs:298">
P2: This new test is Unix-only but runs unconditionally, so the Windows `cargo test` job cannot launch its `#!/bin/sh` fixture (and may not have `chmod`). Gate the test with `#[cfg(unix)]`, or replace the fixture with a platform-neutral test.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

/// Runs the `codync-tui` the setup writes, with a fake `systemctl` and host: it takes the
/// port from the unit systemd reports and runs the host in ~/.local/bin, and falls back to
/// 19222 when there is no unit.
#[test]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This new test is Unix-only but runs unconditionally, so the Windows cargo test job cannot launch its #!/bin/sh fixture (and may not have chmod). Gate the test with #[cfg(unix)], or replace the fixture with a platform-neutral test.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src-tauri/src/ade/codync.rs, line 298:

<comment>This new test is Unix-only but runs unconditionally, so the Windows `cargo test` job cannot launch its `#!/bin/sh` fixture (and may not have `chmod`). Gate the test with `#[cfg(unix)]`, or replace the fixture with a platform-neutral test.</comment>

<file context>
@@ -273,11 +292,57 @@ mod tests {
+    /// Runs the `codync-tui` the setup writes, with a fake `systemctl` and host: it takes the
+    /// port from the unit systemd reports and runs the host in ~/.local/bin, and falls back to
+    /// 19222 when there is no unit.
+    #[test]
+    fn the_terminal_ui_runs_the_setups_host_on_the_services_port() {
+        let tui = SETUP_SCRIPT
</file context>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant