appback-remoteagent 0.15.5 → 0.15.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,9 +4,10 @@ import os from "node:os";
4
4
  import path from "node:path";
5
5
  import { stopSpawnedExecution } from "../adapters/windows-shell.js";
6
6
  const MODEL_PRESETS = {
7
- codex: ["gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.2", "gpt-5.1-codex-max"],
7
+ codex: ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.6", "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.2", "gpt-5.1-codex-max"],
8
8
  claude: ["sonnet", "opus", "haiku"],
9
9
  };
10
+ const DEFAULT_CODEX_MODEL = "gpt-5.6-sol";
10
11
  export class BridgeService {
11
12
  store;
12
13
  adapters;
@@ -59,7 +60,7 @@ export class BridgeService {
59
60
  cwd: workspace,
60
61
  pairedAt: new Date().toISOString(),
61
62
  sessionId: undefined,
62
- model: provider === "codex" ? "gpt-5.5" : "sonnet",
63
+ model: this.defaultModelFor(provider),
63
64
  sandboxMode: provider === "codex" ? this.defaultCodexSandboxMode : undefined,
64
65
  lastUsedAt: undefined,
65
66
  }, workspace);
@@ -94,7 +95,7 @@ export class BridgeService {
94
95
  cwd: workspace,
95
96
  pairedAt: new Date().toISOString(),
96
97
  sessionId: normalizedSessionId,
97
- model: existing?.session[provider]?.model ?? (provider === "codex" ? "gpt-5.5" : "sonnet"),
98
+ model: existing?.session[provider]?.model ?? this.defaultModelFor(provider),
98
99
  sandboxMode: provider === "codex"
99
100
  ? (existing?.session[provider]?.sandboxMode ?? this.defaultCodexSandboxMode)
100
101
  : undefined,
@@ -655,7 +656,7 @@ export class BridgeService {
655
656
  return next?.trim() || current || this.defaultWorkspace;
656
657
  }
657
658
  defaultModelFor(provider) {
658
- return provider === "codex" ? "gpt-5.5" : "sonnet";
659
+ return provider === "codex" ? DEFAULT_CODEX_MODEL : "sonnet";
659
660
  }
660
661
  describeEffectiveAccess(session) {
661
662
  if (!session.codex) {
@@ -9,9 +9,17 @@ RemoteAgent production is operated from one canonical Git history:
9
9
  - production package: `appback-remoteagent`
10
10
  - branch used for production releases: `main`
11
11
 
12
- Do not treat stale server paths or duplicate worktrees as authoritative.
12
+ Use `origin/main` as the authoritative source.
13
13
  Code changes should be committed and pushed to `origin/main`, published to npm, and then server 30/26 should be updated from that npm version.
14
- Installing a local tarball directly on a server is an emergency hotfix only; it is not a completed production release until the same version is published to npm and both targets are reconciled to that npm version.
14
+ Production release commands are:
15
+
16
+ ```bash
17
+ npm run release:publish
18
+ npm run release:deploy -- <version> all
19
+ ```
20
+
21
+ Local tarball installation is an emergency runtime restoration path.
22
+ The production release is completed by publishing the same version to npm and running `npm run release:deploy -- <version> all`.
15
23
 
16
24
  ## Product shape in operations
17
25
 
@@ -33,7 +41,7 @@ Current production bot ownership is intentionally split:
33
41
  - server 30: RemoteAgent production bots
34
42
  - local machine 21: local-only bot runtime
35
43
 
36
- Do not run the same Telegram bot token from multiple runtimes at the same time.
44
+ Assign each Telegram bot token to one runtime at a time.
37
45
  Bot polling conflicts are treated as incidents, not harmless warnings.
38
46
 
39
47
  When a runtime has several configured Telegram bots, polling pressure can become operationally visible.
@@ -135,7 +143,14 @@ If a temporary branch is unavoidable, merge it back to `main`, push it, and depl
135
143
 
136
144
  A task is not done until commit and push both happened.
137
145
  A production deployment is not done until server 30 and server 26 are running the published npm version and the runtime path has been verified.
138
- If npm publish fails with `403`, do not keep retrying or switch to source deployment. Confirm the npm token has publish rights for the unscoped `appback-remoteagent` package, then publish. See `docs/RELEASING.md`.
146
+ If npm publish returns `403`, use a publish-capable npm token for the unscoped `appback-remoteagent` package and run:
147
+
148
+ ```bash
149
+ source ~/.config/remoteagent/npm-token.env
150
+ npm run release:publish
151
+ ```
152
+
153
+ See `docs/RELEASING.md`.
139
154
 
140
155
  See `docs/RELEASING.md` for the detailed versioning rules.
141
156
 
package/docs/RELEASING.md CHANGED
@@ -1,187 +1,176 @@
1
- # Releasing
1
+ # RemoteAgent Release Runbook
2
2
 
3
- ## Versioning rule
3
+ This runbook is command-first. Use the scripts below as the release interface.
4
4
 
5
- RemoteAgent uses semantic versioning for every production deployment:
5
+ ## 1. Bump Version
6
6
 
7
- - `MAJOR`: breaking command changes, storage/runtime contract changes, or migrations that can break an existing installation
8
- - `MINOR`: new user-facing capabilities, new commands, new adapters, or non-breaking workflow expansion
9
- - `PATCH`: bug fixes, reliability improvements, security fixes, text-only corrections, and non-breaking maintenance
7
+ Patch release:
10
8
 
11
- Do not deploy production changes without bumping the package version first.
12
-
13
- ## Decision guide
14
-
15
- Use `PATCH` when the behavior is supposed to stay the same but gets safer or more correct.
16
- Use `MINOR` when the owner can do something new after the release without needing migration.
17
- Use `MAJOR` when an older installation, script, or user workflow would need active adjustment.
9
+ ```bash
10
+ npm run release:version -- patch
11
+ ```
18
12
 
19
- When unsure between two levels, choose the higher one and explain why in the commit message.
13
+ Minor release:
20
14
 
21
- ## Required release flow
15
+ ```bash
16
+ npm run release:version -- minor
17
+ ```
22
18
 
23
- A release is only considered complete when all of the following are done in order:
19
+ Major release:
24
20
 
25
- 1. Choose the release scope: `patch`, `minor`, or `major`
26
- 2. Bump the version in `package.json` and `package-lock.json`
27
- 3. Run `npm run check`
28
- 4. Run `npm run build`
29
- 5. Commit the completed work
30
- 6. Push `main` to `origin/main`
31
- 7. Publish `appback-remoteagent@<version>` to npm using a token/account that is proven to have publish rights for this unscoped package
32
- 8. Install that exact npm version on server 30 and server 26
33
- 9. Restart `remoteagent.service` on each target if runtime code changed
34
- 10. Verify the relevant runtime path, logs, or Telegram behavior on each target
21
+ ```bash
22
+ npm run release:version -- major
23
+ ```
35
24
 
36
- If commit or push is missing, the work is not done.
37
- If server 30 or server 26 is not running the published npm version, the production deployment is incomplete.
25
+ Versioning guide:
38
26
 
39
- ## Commands
27
+ - `patch`: reliability fixes, bug fixes, text fixes, safe maintenance
28
+ - `minor`: new commands, new user-facing behavior, new non-breaking workflow
29
+ - `major`: storage/runtime contract changes or breaking command behavior
40
30
 
41
- Version bump helpers:
31
+ ## 2. Validate
42
32
 
43
33
  ```bash
44
- ./scripts/bump-version.sh patch
45
- ./scripts/bump-version.sh minor
46
- ./scripts/bump-version.sh major
34
+ npm run check
35
+ npm run build
47
36
  ```
48
37
 
49
- Equivalent npm shortcuts:
38
+ ## 3. Commit And Push
50
39
 
51
40
  ```bash
52
- npm run version:patch
53
- npm run version:minor
54
- npm run version:major
41
+ git status --short
42
+ git add -A
43
+ git commit -m "Release <version>"
44
+ git push origin main
55
45
  ```
56
46
 
57
- Typical local release sequence:
47
+ Example:
58
48
 
59
49
  ```bash
60
- ./scripts/bump-version.sh patch
61
- npm run check
62
- npm run build
63
- git status
64
- git add -A
65
- git commit -m "Release 0.12.3"
66
- git push origin main
67
- npm pack
50
+ git commit -m "Release 0.15.5"
68
51
  ```
69
52
 
70
- ## npm publish procedure
53
+ ## 4. Publish To npm
71
54
 
72
- Use this package-specific path for `appback-remoteagent`.
55
+ Load the npm token when the shell has not loaded it yet:
73
56
 
74
- Direct `npm publish` is blocked by `prepublishOnly`.
75
- The only normal publish command is:
57
+ ```bash
58
+ source ~/.config/remoteagent/npm-token.env
59
+ ```
60
+
61
+ Publish:
76
62
 
77
63
  ```bash
78
64
  npm run release:publish
79
65
  ```
80
66
 
81
- Do not publish this package with the machine 21 `21token`.
82
- That token can authenticate as `appbackhub`, but it does not currently have publish rights for the unscoped `appback-remoteagent` package.
83
- It fails at publish time with:
67
+ The publish script performs:
84
68
 
85
- ```text
86
- 403 Forbidden - You may not perform that action with these credentials.
87
- ```
69
+ - clean working tree check
70
+ - `npm whoami`
71
+ - `npm owner ls appback-remoteagent`
72
+ - `npm run check`
73
+ - `npm run build`
74
+ - `npm pack`
75
+ - guarded `npm publish`
76
+ - registry version verification
77
+
78
+ The package publish entrypoint is `npm run release:publish`.
79
+ `scripts/prepublish-guard.mjs` routes manual publish attempts back to that entrypoint.
80
+
81
+ ## 5. Deploy Published Version
88
82
 
89
- Before publishing, always verify both identity and package ownership:
83
+ Deploy to server 30:
90
84
 
91
85
  ```bash
92
- npm whoami
93
- npm owner ls appback-remoteagent
86
+ npm run release:deploy -- <version> 30
94
87
  ```
95
88
 
96
- Authentication alone is not enough.
97
- If `npm whoami` works but `npm publish` returns `403`, stop and get a publish-capable npm token instead of retrying with the same token.
89
+ Deploy to server 26:
90
+
91
+ ```bash
92
+ npm run release:deploy -- <version> 26
93
+ ```
98
94
 
99
- The guarded registry publish path is:
95
+ Deploy to both production targets:
100
96
 
101
97
  ```bash
102
- npm run release:publish
103
- npm view appback-remoteagent version
98
+ npm run release:deploy -- <version> all
104
99
  ```
105
100
 
106
- If registry caching briefly returns the previous version after publish, wait a few seconds and rerun `npm view appback-remoteagent version` before installing to servers.
101
+ Example:
107
102
 
108
- ## Emergency tarball install
103
+ ```bash
104
+ npm run release:deploy -- 0.15.5 all
105
+ ```
109
106
 
110
- An emergency tarball install is allowed only to restore a broken runtime when npm publish is blocked.
111
- It is not a completed release and must be reported as a temporary hotfix.
107
+ The deploy script performs:
112
108
 
113
- Rules:
109
+ - npm registry version check for `appback-remoteagent@<version>`
110
+ - server 30 npm install, install hook, systemd restart, version/log verification
111
+ - server 26 npm install, install hook, user-process restart, version/log verification
114
112
 
115
- - do not call it "npm deployed" or "released"
116
- - do not delete runtime state
117
- - do not use source checkout deployment
118
- - confirm no active provider process is running before restart
119
- - install the exact local package tarball with `npm install -g /tmp/appback-remoteagent-<version>.tgz`
120
- - follow up by publishing the same version to npm once a publish-capable token is available
113
+ ## 6. Verify
121
114
 
122
- Emergency server 30 flow:
115
+ Registry:
123
116
 
124
117
  ```bash
125
- VERSION=0.14.0
126
- npm pack
127
- scp appback-remoteagent-$VERSION.tgz au2223@192.168.0.30:/tmp/
128
- ssh au2223@192.168.0.30 "VERSION=$VERSION bash -s" <<'REMOTE'
129
- set -euo pipefail
130
- export PATH="/home/au2223/.local/bin:/home/au2223/.nvm/versions/node/v22.22.0/bin:$PATH"
131
- pgrep -af 'codex|claude' || true
132
- npm install -g "/tmp/appback-remoteagent-$VERSION.tgz"
133
- remoteagent-install
134
- sudo -n systemctl restart remoteagent
135
- systemctl is-active remoteagent
136
- node -p 'require("/home/au2223/.nvm/versions/node/v22.22.0/lib/node_modules/appback-remoteagent/package.json").version'
137
- journalctl -u remoteagent --since '2 minutes ago' --no-pager
138
- REMOTE
139
- rm -f appback-remoteagent-$VERSION.tgz
118
+ npm view appback-remoteagent version
140
119
  ```
141
120
 
142
- ## Target deployment sequence
143
-
144
- Server 30 uses a systemd service:
121
+ Server 30:
145
122
 
146
123
  ```bash
147
- VERSION=0.14.0
148
- ssh au2223@192.168.0.30 "VERSION=$VERSION bash -s" <<'REMOTE'
149
- set -euo pipefail
124
+ ssh au2223@192.168.0.30 'bash -lc '"'"'
150
125
  export PATH="/home/au2223/.local/bin:/home/au2223/.nvm/versions/node/v22.22.0/bin:$PATH"
151
- npm install -g appback-remoteagent@$VERSION
152
- /home/au2223/.nvm/versions/node/v22.22.0/bin/remoteagent-install
153
- sudo -n systemctl restart remoteagent
154
126
  systemctl is-active remoteagent
155
- node -p 'require("/home/au2223/.nvm/versions/node/v22.22.0/lib/node_modules/appback-remoteagent/package.json").version'
156
- journalctl -u remoteagent --since '2 minutes ago' --no-pager
157
- REMOTE
127
+ node -p "require(\"/home/au2223/.nvm/versions/node/v22.22.0/lib/node_modules/appback-remoteagent/package.json\").version"
128
+ journalctl -u remoteagent --since "5 minutes ago" --no-pager | tail -80
129
+ '"'"''
158
130
  ```
159
131
 
160
- Do not run `sudo npm install -g` on server 30. The global RemoteAgent package is installed under
161
- `/home/au2223/.nvm/versions/node/v22.22.0`; only the `systemctl restart remoteagent` step needs sudo.
162
- Runtime state remains in `/home/au2223/.remoteagent` and must not be deleted during npm upgrades.
163
-
164
- Server 26 currently uses user-level start/stop scripts, not a systemd `remoteagent.service`:
132
+ Server 26:
165
133
 
166
134
  ```bash
167
- VERSION=0.14.0
168
- ssh ospadmin@192.168.0.26 "VERSION=$VERSION bash -s" <<'REMOTE'
169
- set -euo pipefail
170
- npm install -g appback-remoteagent@$VERSION
171
- remoteagent-install
172
- ~/.remoteagent/stop-remoteagent.sh || true
173
- sleep 2
174
- ~/.remoteagent/start-remoteagent.sh
175
- sleep 3
135
+ ssh ospadmin@192.168.0.26 'bash -lc '"'"'
136
+ npm list -g appback-remoteagent --depth=0
176
137
  pgrep -af "appback-remoteagent/dist/index.js"
177
138
  tail -80 ~/.remoteagent/logs/agent.log
178
- REMOTE
139
+ '"'"''
179
140
  ```
180
141
 
181
- ## Other Runtime Follow-up
142
+ ## Release 0.15.5
143
+
144
+ Date: 2026-07-08
182
145
 
183
- Server 30 and server 26 are production runtime targets.
184
- Machine 21 or any other host should be updated only when it intentionally runs a separate RemoteAgent service.
146
+ Changes:
185
147
 
186
- At minimum, the operator should run the install/update flow again and verify the process comes back up cleanly.
187
- For npm installs, the package contains `dist/`, so the target machine should not need a repository checkout or a separate manual build step.
148
+ - Telegram file attachment download now writes to `.part` first.
149
+ - Telegram file attachment download resumes partial files with `curl -C -`.
150
+ - Telegram file attachment download retries up to 4 attempts.
151
+ - Download timeout changed from one 60-second attempt to resumable 120-second attempts.
152
+ - npm publish flow is guarded by `prepublishOnly`.
153
+ - Standard publish command is `npm run release:publish`.
154
+ - Standard deploy command is `npm run release:deploy -- <version> <30|26|all>`.
155
+
156
+ Validated:
157
+
158
+ ```bash
159
+ npm run check
160
+ npm run build
161
+ npm run release:publish
162
+ npm run release:deploy -- 0.15.5 all
163
+ ```
164
+
165
+ Published:
166
+
167
+ ```text
168
+ appback-remoteagent@0.15.5
169
+ ```
170
+
171
+ Runtime targets:
172
+
173
+ ```text
174
+ server 30: 0.15.5 active
175
+ server 26: 0.15.5 running
176
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appback-remoteagent",
3
- "version": "0.15.5",
3
+ "version": "0.15.6",
4
4
  "description": "Personal installable session server for continuing local AI work across PC and Telegram",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,10 +21,9 @@
21
21
  "selftest:telegram": "npm run build && node scripts/selftest-telegram-update.mjs",
22
22
  "prepare": "npm run build",
23
23
  "prepublishOnly": "node scripts/prepublish-guard.mjs",
24
+ "release:version": "bash scripts/release-version.sh",
24
25
  "release:publish": "bash scripts/release-publish.sh",
25
- "version:patch": "npm version --no-git-tag-version patch",
26
- "version:minor": "npm version --no-git-tag-version minor",
27
- "version:major": "npm version --no-git-tag-version major"
26
+ "release:deploy": "bash scripts/release-deploy.sh"
28
27
  },
29
28
  "dependencies": {
30
29
  "dotenv": "^16.6.1",
@@ -5,15 +5,12 @@ if (process.env.REMOTEAGENT_PUBLISH_GUARD_OK === "1") {
5
5
  }
6
6
 
7
7
  console.error([
8
- "Direct npm publish is blocked for appback-remoteagent.",
8
+ "RemoteAgent publishes through the guarded release command.",
9
9
  "",
10
- "Use the documented release path instead:",
10
+ "Command:",
11
11
  " npm run release:publish",
12
12
  "",
13
- "Reason:",
14
- "- direct publish has repeatedly used the wrong npm token",
15
- "- appback-remoteagent must be published only through the guarded script",
16
- "- emergency tarball installs are not completed releases",
13
+ "This command checks the working tree, npm identity, package owner, build, pack, publish, and registry version.",
17
14
  ].join("\n"));
18
15
 
19
16
  process.exit(1);
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ echo "Usage: npm run release:deploy -- <version> <30|26|all>" >&2
6
+ echo "Example: npm run release:deploy -- 0.15.5 all" >&2
7
+ }
8
+
9
+ if [[ $# -ne 2 ]]; then
10
+ usage
11
+ exit 1
12
+ fi
13
+
14
+ VERSION="$1"
15
+ TARGET="$2"
16
+
17
+ if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
18
+ usage
19
+ exit 1
20
+ fi
21
+
22
+ case "$TARGET" in
23
+ 30|26|all)
24
+ ;;
25
+ *)
26
+ usage
27
+ exit 1
28
+ ;;
29
+ esac
30
+
31
+ PACKAGE_NAME="appback-remoteagent"
32
+ REGISTRY_VERSION="$(npm view "$PACKAGE_NAME@$VERSION" version)"
33
+ if [[ "$REGISTRY_VERSION" != "$VERSION" ]]; then
34
+ echo "Registry version check failed for $PACKAGE_NAME@$VERSION" >&2
35
+ exit 1
36
+ fi
37
+
38
+ deploy_30() {
39
+ ssh au2223@192.168.0.30 "VERSION=$VERSION bash -s" <<'REMOTE'
40
+ set -euo pipefail
41
+ export PATH="/home/au2223/.local/bin:/home/au2223/.nvm/versions/node/v22.22.0/bin:$PATH"
42
+ npm install -g "appback-remoteagent@$VERSION"
43
+ remoteagent-install
44
+ sudo -n systemctl restart remoteagent
45
+ sleep 5
46
+ systemctl is-active remoteagent
47
+ node -p 'require("/home/au2223/.nvm/versions/node/v22.22.0/lib/node_modules/appback-remoteagent/package.json").version'
48
+ journalctl -u remoteagent --since '1 minute ago' --no-pager | tail -80
49
+ REMOTE
50
+ }
51
+
52
+ deploy_26() {
53
+ ssh ospadmin@192.168.0.26 "VERSION=$VERSION bash -s" <<'REMOTE'
54
+ set -euo pipefail
55
+ export PATH="$HOME/.local/bin:$PATH"
56
+ npm install -g "appback-remoteagent@$VERSION"
57
+ remoteagent-install
58
+ ~/.remoteagent/stop-remoteagent.sh || true
59
+ sleep 2
60
+ ~/.remoteagent/start-remoteagent.sh
61
+ sleep 5
62
+ npm list -g appback-remoteagent --depth=0
63
+ pgrep -af 'appback-remoteagent/dist/index.js'
64
+ tail -80 ~/.remoteagent/logs/agent.log
65
+ REMOTE
66
+ }
67
+
68
+ case "$TARGET" in
69
+ 30)
70
+ deploy_30
71
+ ;;
72
+ 26)
73
+ deploy_26
74
+ ;;
75
+ all)
76
+ deploy_30
77
+ deploy_26
78
+ ;;
79
+ esac
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ echo "Usage: npm run release:version -- <patch|minor|major>" >&2
6
+ echo "Example: npm run release:version -- patch" >&2
7
+ }
8
+
9
+ if [[ $# -ne 1 ]]; then
10
+ usage
11
+ exit 1
12
+ fi
13
+
14
+ case "$1" in
15
+ patch|minor|major)
16
+ ;;
17
+ *)
18
+ usage
19
+ exit 1
20
+ ;;
21
+ esac
22
+
23
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
24
+ cd "$ROOT"
25
+
26
+ npm version --no-git-tag-version "$1"
27
+ node -p "'RemoteAgent version is now ' + require('./package.json').version"
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- if [ $# -ne 1 ]; then
5
- echo "Usage: $0 <patch|minor|major>" >&2
6
- exit 1
7
- fi
8
-
9
- case "$1" in
10
- patch|minor|major)
11
- ;;
12
- *)
13
- echo "Release type must be one of: patch, minor, major" >&2
14
- exit 1
15
- ;;
16
- esac
17
-
18
- ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
19
- export PATH="$HOME/.local/bin:$PATH"
20
- cd "$ROOT_DIR"
21
-
22
- npm version --no-git-tag-version "$1"
23
- node -p "'RemoteAgent version is now ' + require('./package.json').version"