Skip to content

Commit 5e8aebd

Browse files
authored
fix(session): prevent orphaned task slots blocking allocation (#33) (#35)
* feat: simplify agentic loop and fix critical bugs This PR implements a major refactor and stability overhaul for the agentic loop. Completed Issues: - Fixes #5: Memory leak in fire-and-forget promises (implemented BackgroundTasks tracking) - Fixes #6: Split oversized prompt.ts (extracted session/tools.ts) - Fixes #7: Add BackgroundTasks test suite - Fixes #8: Fix silent tool failure in background (added result tracking and events) - Fixes #9: Add Stream module unit tests (comprehensive coverage) - Fixes #10: Fix race condition in Remory search (added request tracking) - Fixes #11: Fix unhandled abort during stream cleanup - Fixes #12: Implement check_task tool - Fixes #13: Add config schema validation - Fixes #14: Upgrade Remory to Unix socket (implemented in socket-client.ts) - Fixes #16: Fix code style violations Changes: - Extracted tool resolution logic to `src/session/tools.ts` - Implemented `BackgroundTasks` utility for promise tracking - Added `check_task` tool for polling background tasks - Upgraded Remory client to use Unix sockets and JSON-RPC - Added comprehensive tests for Stream and BackgroundTasks * feat: auto-wakeup agent context and build fixes * chore: clean up workflows for independent fork - Remove upstream publishing workflows (npm, vscode, tauri, etc.) - Change branch references from dev to main - Keep test, typecheck, and issue management workflows * docs: replace README with oclite fork documentation - Add attribution to upstream OpenCode project (MIT requirement) - Document build-from-source installation - Explain philosophy: opinionated defaults, agentic workflows, remory integration - List differences from upstream (no desktop app, VS Code, npm publishing) - Keep it concise and focused on single developer use case * docs: add README and release workflow for independent fork - New README with installation, philosophy, attribution - GitHub Actions workflow for building/releasing binaries - Closes #23, closes #24 * feat: lazy load AI SDKs and fix typecheck errors - Convert 21 AI provider imports to dynamic imports - Add null checks in github.ts - Fix task.ts and test type definitions - Enable minification in build - Improve TUI activity streaming * fix: use git toplevel for worktree path (#31) * fix(session): prevent orphaned task slots blocking allocation (#33) - Store release_slot callback in TaskMetadata for lifecycle tracking - Release slot in trackBackgroundTask finally block (handles timeout/crash/abort) - Fix double-release race in task.ts with slotReleased guard - Release slot before metadata deletion in cancelBackgroundTask - Simplify cleanupAllTaskSlots to prevent race with finally blocks - Add comprehensive AGENTS.md aligned with project standards (#34) Closes #33 Closes #34 * fix(tool): correct CheckTask error handling and test context - Use try/catch instead of Promise chaining for Session.get errors - Add sessionID to test context for proper caller identification * chore(ci): simplify workflows to essential test suite only Remove inherited upstream workflows. Keep only basic CI for typecheck and tests. * fix(ci): run tests from packages/opencode directory * fix(ci): run tests from correct directory Previously the ci.yml had incorrect working directory placement, causing tests to run from root which exits with error code 1.
1 parent 0cc206a commit 5e8aebd

67 files changed

Lines changed: 6933 additions & 2544 deletions

Some content is hidden

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

‎.github/workflows/ci.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: oven-sh/setup-bun@v1
16+
with:
17+
bun-version: latest
18+
19+
- run: bun install
20+
21+
- run: bun typecheck
22+
23+
- working-directory: packages/opencode
24+
run: bun test

‎.github/workflows/daily-issues-recap.yml‎

Lines changed: 0 additions & 166 deletions
This file was deleted.

‎.github/workflows/daily-pr-recap.yml‎

Lines changed: 0 additions & 169 deletions
This file was deleted.

‎.github/workflows/deploy.yml‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)