- Branch:
rebase/upstream-sync(based onupstream/dev) - Latest commit:
fbf48f48d(feat: scheduler cron heartbeat runtime) - Active todos:
rebase-ui— donerebase-tts— donerebase-review— donerebase-autopilot— donerebase-session— donerebase-infra— donerebase-verify— in progress
- Rebased branch onto latest
upstream/devand resumed full verification. - Fixed major post-rebase test cascade caused by unhandled async logger write failures:
packages/core/src/util/log.ts- logger file writes now resolve safely on stream errors (no unhandled rejections during teardown).
- Fixed shell output race causing intermittent
(no output)regressions:packages/opencode/src/tool/shell.ts- now joins output reader fiber before finalizing output.
- Current verification snapshot:
packages/opencode:bun typecheck✅packages/app:bun run build✅packages/opencode:bun test=>2617 pass / 11 skip / 2 todo / 6 fail
- Remaining 6 fails are environment/baseline in this machine context:
ModelsDev Service > get() returns {} when disk empty and fetch disabled(local model snapshot state)provider HttpApi > matches legacy OAuth authorize response shapes("null"body parity)Worktree > list > uses parent folder name when worktree basename matches the primary worktree(/tvs/Tpath-case mismatch)- three
Project.fromDirectory with bare repostests (safe.bareRepository=explicit)
- Pending user-requested publish/deploy actions:
- tag current
origin/dev✅ (dev-backup-20260509-031153) - force-push rebased
rebase/upstream-synctoorigin/dev✅ (333a6e07d) - deploy/restart VM service and re-check original session page ✅
- VM updated at
/home/azureuser/workspace/opencode-deploy-159-OhZXeN - Bun upgraded to
1.3.13 - rebuilt SDK + app + opencode binary (
0.0.0-dev-202605091020) - restarted
opencode-servesuccessfully - original failing session URL now loads (no
l.client.vcs.diff is not a functioncrash page)
- VM updated at
- tag current
-
Scheduler/cron heartbeat runtime committed:
- commit
fbf48f48d - includes scheduler subsystem +
cronCLI/tool wiring + serve startup integration. - regression fixed while porting:
- resolved
ToolRegistryinit cycle by lazy-loadingCronToolintool/registry.ts.
- resolved
- validation:
packages/opencode:bun typecheckpackages/opencode:bun test test/scheduler/index.test.ts test/scheduler/store.test.ts test/tool/cron.test.tspackages/opencode:bun test test/tool/registry.test.ts test/session/instruction.test.tspackages/app:bun run build
- commit
-
Full verification snapshot after scheduler commit:
packages/opencode:bun test=>2590 pass / 11 skip / 2 todo / 4 fail- same 4 baseline/environment failures as before (
ModelsDev+ 3 bare-repo tests), no new regressions from this branch.
-
Infra memory-pressure hardening committed:
- commit
f61a0fd33 - added bounded log retention/trimming in
packages/core/src/util/log.ts(128MB cap across.log/.ndjsonwith active-log tail trim). - switched PTY scrollback from monolithic string buffer to bounded chunk retention in
packages/opencode/src/pty/index.ts. - added snapshot memory-artifact retention helper (
packages/opencode/src/diagnostic/memory.ts) and tests. - new/updated tests:
packages/opencode/test/memory/retention.test.tspackages/opencode/test/util/log.test.ts
- commit
-
Validation passed for infra port scope:
packages/opencode:bun typecheckpackages/opencode:bun test test/memory/retention.test.ts test/util/log.test.ts test/pty/pty-shell.test.ts
-
Scheduler/cron heartbeat port is now integrated (uncommitted in working tree):
- added scheduler subsystem:
packages/opencode/src/scheduler/index.tspackages/opencode/src/scheduler/store.tspackages/opencode/src/scheduler/runner.tspackages/opencode/src/scheduler/heartbeat.ts
- added CLI + tool surfaces:
packages/opencode/src/cli/cmd/cron.tspackages/opencode/src/tool/cron.ts- wired in
serve.ts,index.ts, config schema, and tool registry.
- tests added:
packages/opencode/test/scheduler/index.test.tspackages/opencode/test/scheduler/store.test.tspackages/opencode/test/tool/cron.test.ts
- regression caught and fixed during port:
ToolRegistryinit cycle (Cannot access 'defaultLayer' before initialization) resolved by lazy-loadingCronToolintool/registry.ts.
- validation:
packages/opencode:bun typecheckpackages/opencode:bun test test/scheduler/index.test.ts test/scheduler/store.test.ts test/tool/cron.test.tspackages/opencode:bun test test/tool/registry.test.ts test/session/instruction.test.tspackages/app:bun run build
- added scheduler subsystem:
-
Autopilot+heartbeat port committed:
- commit
343fde6a8
- commit
-
Autopilot+heartbeat port is now integrated and green on targeted tests.
-
Fixed one regression introduced during autopilot test updates:
test/agent/agent.test.tsnow matches actual default fallback behavior (planwhenbuildis disabled).
-
Targeted validation passed:
packages/opencode:bun typecheckpackages/opencode:bun test test/agent/agent.test.ts test/tool/shell.test.ts test/session/prompt.test.ts
-
Full suite snapshot after autopilot port:
packages/opencode:bun test=>2583 pass / 11 skip / 2 todo / 4 fail- failing 4 tests remain the known baseline/environmental set (
ModelsDev+ 3 bare-repo tests), unchanged from prior triage.
-
Install gate note:
- repo currently has no
install:localscript (bun run install:localnot available).
- repo currently has no
-
Current uncommitted scope for next commit:
- new autopilot tool + prompt assets
- autopilot native agent permissions
- autopilot loop reflection injection
- shell metadata heartbeat while quiet
- TUI switch back to
buildafterautopilot_exit
- UI recent routing fix:
sidebar-recent.tsxnow usesbase64Encode(session.directory)for session slug.
- TTS hardening:
tts.tsvalidates trimmed text input (z.string().trim().min(1)).server.tsmounts/ttsfor HttpApi backend requests.tts/edge.tsnow removes the temp directory viarm(..., { recursive: true, force: true }).test/tts/route.test.tsincludes whitespace input rejection coverage.
- Verification completed for these changes:
packages/opencode:bun typecheckpackages/app:bun run buildpackages/opencode:bun test test/tts/route.test.ts test/tts/edge.test.ts
- Verification + regression cleanup (uncommitted):
packages/opencode/src/server/server.ts- removed
/ttsHono bypass fromcreateHttpApi(this caused HttpApi parity drift).
- removed
packages/opencode/src/server/routes/instance/httpapi/groups/global.ts- added
POST /tts/edgeendpoint to Effect HttpApi schema (tts.edge).
- added
packages/opencode/src/server/routes/instance/httpapi/handlers/global.ts- added raw handler for
/tts/edgewith body validation + MP3 response.
- added raw handler for
packages/opencode/src/server/routes/instance/httpapi/public.ts- excluded
/tts/*from injected instance query params to match legacy Hono OpenAPI shape.
- excluded
- Validation green for current in-progress code:
packages/opencode:bun typecheckpackages/opencode:bun test test/server/httpapi-bridge.test.ts test/tts/route.test.ts test/tts/edge.test.ts test/session/auto-resume.test.ts
- Committed HttpApi/TTS parity fix:
- commit
bb95c60ee /tts/edgeis now served from Effect HttpApi (no Hono bypass increateHttpApi).- OpenAPI parity tests for HttpApi bridge are passing again.
- commit
- Verified app-level fork ports:
packages/app:bun test src/pages/session/auto-review.test.ts src/utils/recent-session.test.ts
- Passing:
packages/opencode:bun typecheckpackages/app:bun run buildbun install- targeted tests for HttpApi/TTS/auto-resume and app auto-review/recent-session
- Full
packages/opencodetest suite currently reports 4 failures, all outside touched files:ModelsDev Service > get() returns {} when disk empty and fetch disabled- three
Project.fromDirectory with bare repostests
- Confirmed via cross-check on
upstream/dev: all 4 failing tests reproduce as environment/baseline issues, not branch regressions. - Details:
ModelsDev Servicefailure depends on local generated artifactpackages/opencode/src/provider/models-snapshot.js(gitignored). Fresh worktree without this file passes.- bare-repo
Project.fromDirectoryfailures are tied to local git config (safe.bareRepository=explicit) blocking test worktree creation.
-
Resolve/triage remaining full-suite failures
- completed: confirmed as baseline/environment, not introduced by rebase branch changes.
-
Port autopilot + infra groups (deferred heavy work)
- Effect-native rewrites only; avoid direct fork file copy.
-
Port session resilience incrementally
- Integrate
session/auto-resume.tsinto upstreamserveflow using Effect-compatible patterns. - Rework/replace fork-only tests that depend on
Instance.provide.
- Integrate
-
Defer heavy rewrites into separate commits
- Autopilot/heartbeat/scheduler and infra changes should be ported as explicit Effect-native rewrites, not direct file copies.
- Keep each logical area in separate commits to simplify review/rebase.
-
Verification gate before push
cd packages/opencode && bun typecheckcd packages/app && bun run buildbun install(repo has noinstall:localscript)cd packages/opencode && bun test
-
Publish + tracking
- Push
rebase/upstream-syncto fork. - Open/update PR against
dzianisv/opencode. - Update linked issue with status and commit/PR references.
- Push
- Subagent
port-app-uifound a valid route bug fix insidebar-recent.tsx(slugshould be encoded directory, not"recent"). port-ttssubagent hit rate limits; current local TTS route/module diffs should be treated as primary source.