Skip to content

Commit f6ce13f

Browse files
committed
sami: octopus merge — all features + memory leak fixes + telemetry
Merges 15 branches into sami fork: Features: - feat(config): webMode/webUrl server config - feat(app): ?server= query param, direct-load mode - feat(app): continuous voice mode (VAD, state machine, barge-in, wake lock) - feat(session): custom session ID, messageCount endpoint - feat(session): index-based message ordering, hardened prompt loop - feat(plugin): skills accessor via PluginInput.skills - feat(plugin): last-wins auth override for user plugins - feat(bun): github ref plugins, dist-tag version resolution, model limit overrides - feat: memory telemetry sampler — periodic bun:jsc heapStats + objectTypeCounts - ci: sami-build workflow Fixes: - fix: memory leak fixes from PR anomalyco#16695 (binarydoubling), adapted to Effect APIs - fix: instance idle-timeout disposal for serve mode - fix(tui): disposal recovery, checkUpgrade error logging Telemetry: - Periodic memory sampler (5s interval, delta-based logging, 50MB threshold) - SIGTERM handler writes heap snapshot to /tmp - SIGUSR2 on-demand heap snapshot without exit
18 parents f7a4cca + b5d64e6 + fdb6902 + 4f5e1c0 + d22e8ff + 5fd353a + 625c8a6 + af0aef3 + 0a4ad48 + cdbd72a + dd2e449 + abffa71 + 8c64ae2 + d636601 + 85d91d8 + e47f53d + 7f23a61 + e00bfe0 commit f6ce13f

File tree

126 files changed

+7061
-570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+7061
-570
lines changed

.github/workflows/sami-build.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: Build sami branch
2+
3+
on:
4+
push:
5+
branches:
6+
- sami
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
env:
13+
BUN_VERSION: "1.3.11"
14+
15+
jobs:
16+
version:
17+
name: Compute version
18+
runs-on: ubuntu-latest
19+
outputs:
20+
tag: ${{ steps.version.outputs.tag }}
21+
version: ${{ steps.version.outputs.version }}
22+
timestamp: ${{ steps.version.outputs.timestamp }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: sjawhar/.github/.github/actions/sami-version@v1
26+
id: version
27+
with:
28+
source: bun
29+
manifest_path: packages/opencode/package.json
30+
31+
build-frontend:
32+
name: Build frontend
33+
needs: version
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: oven-sh/setup-bun@v2
38+
with:
39+
bun-version: ${{ env.BUN_VERSION }}
40+
- run: bun install
41+
- run: bun run build -- --base /opencode/${{ needs.version.outputs.tag }}/
42+
working-directory: packages/app
43+
- name: Upload frontend dist
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: frontend-dist
47+
path: packages/app/dist/
48+
49+
deploy-frontend:
50+
name: Deploy frontend to GitHub Pages
51+
needs: [version, build-frontend]
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Download frontend dist
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: frontend-dist
58+
path: frontend-dist
59+
60+
- name: Deploy to gh-pages branch
61+
run: |
62+
TAG="${{ needs.version.outputs.tag }}"
63+
64+
git config --global user.name "github-actions[bot]"
65+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
66+
67+
REPO_URL="https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"
68+
69+
# Clone gh-pages branch or create it
70+
if git clone --depth 1 --branch gh-pages "${REPO_URL}" pages-repo 2>/dev/null; then
71+
echo "Cloned existing gh-pages branch"
72+
else
73+
mkdir pages-repo && cd pages-repo
74+
git init
75+
git checkout --orphan gh-pages
76+
touch .nojekyll
77+
git add .nojekyll
78+
git commit -m "Initialize gh-pages"
79+
git remote add origin "${REPO_URL}"
80+
cd ..
81+
fi
82+
83+
# Add versioned directory
84+
mkdir -p "pages-repo/${TAG}"
85+
cp -r frontend-dist/* "pages-repo/${TAG}/"
86+
touch pages-repo/.nojekyll
87+
88+
cd pages-repo
89+
git add .
90+
git commit -m "Deploy frontend ${TAG}"
91+
git push origin gh-pages
92+
env:
93+
GITHUB_TOKEN: ${{ github.token }}
94+
95+
build-cli:
96+
name: Build CLI
97+
needs: [version, build-frontend]
98+
runs-on: ubuntu-latest
99+
timeout-minutes: 30
100+
steps:
101+
- uses: actions/checkout@v4
102+
- uses: oven-sh/setup-bun@v2
103+
with:
104+
bun-version: ${{ env.BUN_VERSION }}
105+
- run: bun install
106+
107+
- name: Build CLI binaries
108+
env:
109+
OPENCODE_VERSION: ${{ needs.version.outputs.version }}-sami.${{ needs.version.outputs.timestamp }}
110+
run: bun run script/build.ts
111+
working-directory: packages/opencode
112+
113+
- name: Create direct-load launcher scripts
114+
run: |
115+
TAG="${{ needs.version.outputs.tag }}"
116+
FRONTEND_URL="https://sjawhar.github.io/opencode/${TAG}/"
117+
for dir in packages/opencode/dist/opencode-*/bin/; do
118+
{
119+
echo '#!/bin/sh'
120+
printf 'export OPENCODE_WEB_URL="%s"\n' "${FRONTEND_URL}"
121+
echo 'exec "$(dirname $0)/opencode" web --web-mode direct "$@"'
122+
} > "${dir}launch-web.sh"
123+
chmod +x "${dir}launch-web.sh"
124+
done
125+
echo "Created launcher scripts in $(ls -d packages/opencode/dist/opencode-*/bin/ | wc -l) platform directories"
126+
127+
- name: Package binaries
128+
run: |
129+
TAG="${{ needs.version.outputs.tag }}"
130+
cd packages/opencode/dist
131+
for dir in opencode-*/; do
132+
name="${dir%/}"
133+
tar czf "${name}-${TAG}.tar.gz" -C "${dir}bin" .
134+
done
135+
ls -la *.tar.gz
136+
mv *.tar.gz ../../../
137+
138+
- name: Upload build artifacts
139+
uses: actions/upload-artifact@v4
140+
with:
141+
name: opencode-cli
142+
path: "*.tar.gz"
143+
144+
release:
145+
name: Create release
146+
needs: [version, build-cli]
147+
runs-on: ubuntu-latest
148+
steps:
149+
- name: Download CLI artifacts
150+
uses: actions/download-artifact@v4
151+
with:
152+
name: opencode-cli
153+
path: artifacts
154+
155+
- uses: sjawhar/.github/.github/actions/sami-release@v1
156+
with:
157+
tag: ${{ needs.version.outputs.tag }}
158+
files: artifacts/*

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ opencode-dev
2828
logs/
2929
*.bun-build
3030
tsconfig.tsbuildinfo
31+
32+
# VAD runtime assets (fetched from node_modules)
33+
packages/app/public/*.wasm
34+
packages/app/public/*.onnx

0 commit comments

Comments
 (0)