40 Commits

Author SHA1 Message Date
open-agents-bot[bot]
9679c867ce
chore: rename open-harness to open-agents (#703)
* refactor: rename open-harness to open-agents

* refactor: replace ai-sdk import with inline FetchFunction type

* refactor: rename "Open Agents" to "Open Agent"

* fix: align chat runtime package imports

---------

Co-authored-by: willsather <56037657+willsather@users.noreply.github.com>
Co-authored-by: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
2026-04-20 23:09:41 -05:00
Nico Albanese
f1d6e2f220
feat: update deps and add Opus 4.7 adaptive thinking support (#801)
* feat: add Opus 4.7 adaptive thinking support

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* chore(deps): update ai sdk dependencies for opus 4.7

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

---------

Co-authored-by: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
2026-04-16 17:22:24 +02:00
Nico Albanese
9ca9d969b9
chore: upgrade ai sdk dependencies and remove devtools (#775)
* chore: upgrade ai sdk dependencies

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* chore: remove @ai-sdk/devtools dependency

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* Remove unused AI SDK devtools middleware

---------

Co-authored-by: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
2026-04-15 17:11:21 +02:00
Nico Albanese
631a50f1a4
feat: add vercel base snapshot refresh tooling (#590)
Keep base snapshot updates repeatable from the repo and record the latest code-server snapshot in config.
2026-04-03 14:59:44 +01:00
openharness[bot]
21a16cc096
chore: update all dependencies (#564)
* chore(deps): update all dependencies

* chore: update all dependencies

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-03-31 17:27:59 +00:00
Hayden Bleasel
8694312489
Replace Biome with Ultracite (oxlint + oxfmt) (#525)
* Install oxlint/oxfmt with Ultracite

* Remove Biome, update commands

* Synthesis

* Update

* Update

* Update .oxlintrc.json

* Update .oxlintrc.json

* Update .oxlintrc.json

* Remove nested configs

* Update .oxlintrc.json

* Update .oxfmtrc.jsonc

* Run fix

* Fix CI

* Update design-system.md

* Restore md files

* Update .oxfmtrc.jsonc

* Update docs
2026-03-20 09:15:18 -07:00
Nico Albanese
44e45791dc
Simplify platform to web + cloud-only agent runtime (#443)
* Remove CLI from project

* Simplify agent approvals to bash safety only

* simplify agent cloud execution model

* hardcode bash safety policy

* Remove agent context compaction

* remove

* updates

* refactor(agent): replace call options with agent factories

* refactor(agent): remove prepareCall from agents

* Use model selections in agent factory

* Relax bash approval heuristics

* Remove local and in-memory sandboxes

* Refactor agent sandbox config to be serializable

* Fix stale bash approval test

* Revert "refactor(agent): replace call options with agent factories"

This reverts commit b0b8345526b2dd152fe09b0ef25bd5b868290345.

* refactor(agent): remove live sandbox from call options

* refactor(agent): remove live sandbox compatibility path

* refactor: extract chat auth context into reusable module (#444)

Co-authored-by: nicoalbanese
<49612682+nicoalbanese@users.noreply.github.com>

* resolve merge conficts

* soft reconnect fix

* remove dead compaction context code from chat request helpers
2026-03-16 09:31:20 +00:00
openharness[bot]
0e2ab8594b
chore: update AI SDK dependencies to latest versions (#447)
Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-03-13 23:13:48 +00:00
openharness[bot]
59909f1bf0
refactor: extract API helpers and consolidate session context logic (#446)
* test: add comprehensive tests for delete message endpoint

* refactor: extract session auth checks into reusable helpers

* docs: add test:verbose script and align formatting in AGENTS.md

* style: format test file with consistent indentation

* test: add isolated test runner and update sandbox status mocks

* refactor: consolidate session auth checks into reusable helpers

* feat: extract PR generation helpers into separate module

* test: add comprehensive test coverage for PR generation helpers

* docs: remove completed API refactoring plan

* style: format function signatures and long lines

* test: refactor session API route mocks to use session-context

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-03-13 22:48:18 +00:00
openharness[bot]
576f608fc8
feat(web): automate DB migrations on build and add drift checks (#372)
* docs: add database migration audit and preview deployment guide

* feat: add migration baseline for db:push-bootstrapped databases

* feat: add shares and usage_events tables with indexes

* refactor: improve db migration baseline detection and logging

* fix: make postgres url optional in drizzle config and add db check to ci

* docs: clarify db branching and format code

* refactor: use db:generate script instead of direct drizzle-kit

* docs: add CI/script execution rules to AGENTS.md

* feat: add database table existence check in migration baseline

* update ci script

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
Co-authored-by: nicoalbanese <gcalbanese96@gmail.com>
2026-03-04 14:23:51 +00:00
openharness[bot]
81d80075f7
chore: update AI SDK dependencies (#336)
Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-03-03 10:11:06 +00:00
Nico Albanese
d35b626d2a
update openai settings for duplicate message error (#319)
* update openai settings for duplicate message error

* format
2026-02-27 11:51:46 +00:00
openharness[bot]
f0a5ead0ad
ci: add bun test to ci script (#311)
* ci: add bun test to ci script

* docs: update ci script description to include tests

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-02-26 11:02:01 +00:00
Nico Albanese
aab42152f0
Revert "Exempt API routes and install script from Vercel deployment protection (#186)" (#188)
This reverts commit a005e17ff048a2f56b974c68b2c8579a66b4f151.
2026-02-18 15:16:01 +01:00
Nico Albanese
a005e17ff0
Exempt API routes and install script from Vercel deployment protection (#186)
* Exempt API routes and install script from Vercel deployment protection

Use vercel.ts with deploymentEnv() to add x-vercel-protection-bypass
headers at the edge for /api/* and /install routes. This replaces the
previous approach of threading the bypass secret through React component
props and CLI fetch headers, which exposed the secret in the browser.

* fix vercel.ts import parsing for config compilation

* document bunx --bun vercel config validation

* fix vercel header config when bypass secret is unset

* fix vercel.ts export shape for header schema

* guard vercel bypass headers on missing secret
2026-02-18 11:59:37 +01:00
Nico Albanese
ecd36e3b9b
centralize AI SDK versions in catalog (#181)
align CLI deps with catalog and drop root ai and zod to prevent version drift
2026-02-17 17:31:25 +01:00
Nico Albanese
2d4a752fd7
update ai sdk (#151) 2026-02-05 21:36:10 +00:00
Nico Albanese
3825b48f2d
update proxy (#145) 2026-02-04 19:03:04 +00:00
Nico Albanese
b1097fd219
add logs and update cli script for local dev (#142) 2026-01-31 17:47:15 +00:00
Nico Albanese
b3fe5f2607
Improve CLI release packaging (#137)
* Improve CLI release packaging

* chore: format files for CI

* Make OpenTUI platform deps optional
2026-01-31 16:21:57 +00:00
Nico Albanese
b283f819c4
add install script and rebrand web app (#136)
* Add configurable installer and homepage install card

* Redesign unauthed homepage with improved visual design and UX

* Add CLI connect banner to authenticated homepage and install card to tokens settings

* Use drizzle-kit migrate in prebuild and document POSTGRES_URL requirement

* Rename deep agent exports to Open Harness

* Redesign landing and CLI auth pages with dark terminal aesthetic

* Add design system documentation for dark terminal aesthetic

* Remove tech stack pills from landing page

* Add sign in button to landing page navbar

* Use drizzle-kit push in web prebuild
2026-01-30 17:30:47 +00:00
Nico Albanese
6d19dd850e
tui: migrate to OpenTUI and update gateway proxy (#130)
* tui: migrate from Ink to OpenTUI for improved input performance

Replace Ink with OpenTUI (@opentui/core, @opentui/react) to fix input lag
issues that were noticeable in long conversations.

Key changes:
- Add ink-shim.tsx compatibility layer to minimize component rewrites
- Replace manual chalk/marked markdown rendering with native <Markdown>
- Use TreeSitter-based syntax highlighting via OpenTUI
- Add ScrollBox with sticky scroll for better chat UX
- Refactor text-input to use segment-based rendering with attributes
- Update renderer initialization to use OpenTUI's createCliRenderer

The shim layer preserves Ink's API surface (Box, Text, useInput, useApp)
while using OpenTUI's renderer underneath. This enables incremental
migration to native OpenTUI patterns in follow-up work.

Removed dependencies: ink, ink-spinner, ink-text-input, cli-highlight
Added dependencies: @opentui/core, @opentui/react

* tui: align layout rows and centralize primary color

* tui: keep tool output readable in narrow terminals

* tui: align assistant text and show copy feedback

* tui: refine input shortcuts and mouse filtering

* tui: chunk stream output by line

* web: format avatar and dropdown menu components

* db: format migration metadata

* tui: use OpenTUI diff and code previews

* tui: refine clipboard toast styling

* fix: fetch models via web api

* feat: surface model context limits

* tui: improve interruption and question flow readability

* fix tui auto-submit after abort

* tui: keep input visible on typing

* chore: add ci script for core checks

* docs: note ci script in agent guide

* fix: use authenticated gateway models

* fix: enrich gateway models with context limits

* update lock

* update agents md
2026-01-30 10:51:52 +00:00
Nico Albanese
0f67cf579f
improve agent performance (#127)
* format

* update deps

* add skills

* update ci for formatting
2026-01-29 10:20:12 +00:00
Nico Albanese
9ccd4c82f1
Replace sandbox state null checks with active state validation (#108)
* Add token usage reporting for subagents

Display input tokens inline in task views next to tool count and duration.
Shows tokens while streaming and final count on completion.

Changes:
- Add messageMetadata callback to task tool to attach usage data
- Add token display to TUI and web task-group-view components
- Add tokens to task-renderer completion views
- Refactor web task-renderer to use proper types instead of casts
- Switch tool-call.tsx to narrow on part.type instead of derived string
- Add SubagentUIMessage type for proper typing of subagent output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Consolidate formatTokens and improve type safety

- Move formatTokens to shared package to eliminate duplication across 4 files
- Add getToolSummary helper with proper type narrowing (replaces unsafe cast)
- Simplify IIFE patterns to ternary expressions in task renderers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Migrate from custom blob snapshots to native Vercel snapshots

Replace the custom tarball-based snapshot system with Vercel's native
snapshot API. This simplifies the codebase and removes the @vercel/blob
dependency.

Key changes:
- snapshot() now uses native SDK method (automatically stops sandbox)
- Restoration happens at sandbox creation via source: { type: 'snapshot' }
- Added backwards compatibility for legacy blob URLs (https://)
- Removed SnapshotOptions, renamed RestoreOptions to LegacyRestoreOptions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix code review issues from snapshot migration

- Configure git user after native snapshot restoration in vercel and hybrid sandboxes
- Only render expanded input when non-empty in task-renderer
- Restore getToolSummary fallback for unknown tool types
- Remove legacy blob snapshot code (isLegacySnapshot, restoreLegacySnapshot, LegacyRestoreOptions)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Extract configureGitUser utility and remove legacy blob comments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add sandbox snapshot reliability plan

Documents two approaches for ensuring sandboxes are snapshotted before
timeout even when clients are inactive:
- Approach A: Snapshot after every assistant response + auto-extend
- Approach B: Cron-based snapshot for sandboxes near expiration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Preserve sandbox type on stop/snapshot for correct restoration

- Add isSandboxActive() type guard and clearSandboxState() helper
- Update API routes to use isSandboxActive() for active sandbox checks
- Preserve sandbox type in sandboxState when stopping/snapshotting
- Fix snapshot restoration to not create sandbox first (was preventing
  snapshot restore due to sandboxId taking precedence over snapshotId)
- Update frontend task context to preserve type on state clearing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add expiresAt tracking to sandbox state for client-side expiration checks

Store expiresAt timestamp in persisted sandbox state so the client can
immediately determine if a sandbox has expired without making a network
call. This fixes the issue where the UI shows "active" for expired
sandboxes until a network call fails.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix sandbox timeout snapshot and cleanup flow

- Add canOperateOnSandbox() to allow operations on expired sandboxes
- Make DELETE /api/sandbox idempotent (return success if already stopped)
- Fix snapshot response parsing to use snapshotId instead of downloadUrl

The client was looking for 'downloadUrl' but the API returns 'snapshotId',
causing the task's snapshotUrl to never be updated locally. This made the
UI show "Create sandbox" instead of "Resume sandbox" after timeout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* add comment

* Fix sandbox utils type safety and snapshot restore race condition

- Add comprehensive JSDoc comments to isSandboxActive and canOperateOnSandbox
- Extract hasRuntimeState helper to reduce code duplication
- Fix clearSandboxState to use explicit switch instead of type cast
- Add null check for getState result in extend route
- Prevent snapshot restore while sandbox is running (race condition fix)
- Only pass type and snapshotId when restoring (avoid stale sandboxId)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Consolidate sandbox timeout configuration into single file

- Create apps/web/lib/sandbox/config.ts with timeout constants
- Replace hardcoded 300_000 values across web app with shared constants
- DEFAULT_SANDBOX_TIMEOUT_MS for new sandboxes
- EXTEND_TIMEOUT_DURATION_MS for timeout extensions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix sandbox timeout propagation and client display on refresh

- Add timeout option to ConnectOptions and pass through to Vercel SDK
- Pass DEFAULT_SANDBOX_TIMEOUT_MS when creating sandboxes in web app
- Return expiresAt from reconnect endpoint for accurate client display
- Calculate remaining timeout from expiresAt on reconnect (not default)
- Pass remainingTimeout when restoring from snapshot
- Display remaining seconds next to sandbox status indicator

Previously, the timeout was only sent to the client but not to the SDK,
causing sandboxes to use the SDK's 300s default. On refresh, the client
would also reset to the default instead of showing actual remaining time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* update

* Fix timeout propagation when restoring hybrid sandbox from snapshot

Pass remainingTimeout to VercelSandbox.connect() during snapshot restoration,
matching the pattern in vercel/connect.ts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 23:08:28 +00:00
Nico Albanese
ba80698994
Add model selection and settings persistence to TUI (#101)
* Add slash commands for CLI settings with /model command

Implement a slash command system for the CLI that allows users to
configure settings via interactive panels. The first command is /model
which opens a searchable model selection panel.

Features:
- Slash command detection when typing "/" at start of input
- Generic SettingsPanel component with search/filter support
- Model selection with name, description, and pricing info
- Settings persistence to ~/.config/open-harness/settings.json
- Dynamic model switching without restarting the CLI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Improve model selector with windowed display and cleaner UI

- Limit visible options to 5 at a time with scroll indicators
- Remove model descriptions, show only name and pricing
- Fix vim keys (j/k) to only work when not actively searching

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add dynamic model fetching from gateway API

Fetch available models from the AI gateway at startup instead of using
a hardcoded list. Add Zod schema validation for settings. Pass available
models through TUI options to the chat context.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Improve model selector UX and add defensive pricing handling

- Remove getModelDisplayName, display raw model ID in header instead
- Remove tab key navigation from settings panel
- Add model ID to search filter for easier lookup
- Add NaN check in formatPricing to handle invalid gateway data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix settings panel lag when navigating with arrow keys

Memoize options array and callbacks in app.tsx to prevent unnecessary
re-renders. Replace useEffect with synchronous state updates and refs
in settings-panel.tsx to avoid render cascades when navigating.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix settings panel React state management and suppress SDK warnings

Move search query reset logic to useEffect for proper React lifecycle
handling and add guards to prevent callbacks from firing during initial
render. Also suppress AI SDK log warnings in the CLI dev script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Refactor TUIOptions to use standard type imports

Replace inline import("...").Type syntax with proper type imports at
the top of the file for Settings and ModelInfo types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix exports

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 18:07:11 +00:00
Nico Albanese
0dd202b0c1
Add sandbox snapshot support with Vercel Blob storage (#71)
* add plan for docs sandbox

* update plan

* Fix sandbox update condition for recreation

* Add snapshot schema and migration

* Add snapshot types to sandbox interface

* Implement snapshot and restore in Vercel sandbox

* Add snapshot API endpoints

* Add snapshot UI and state management

* Fix snapshot security and error handling issues

- Add sandbox ownership check to PUT restore endpoint
- Clean up temporary archive file after snapshot upload
- Add error state and UI feedback for restore failures
- Extract shared snapshot save logic to reduce duplication

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix snapshot restore option not appearing after first save

Update task state in React context after saving a snapshot so the
restore option appears immediately without requiring a page refresh.
Also sync sandboxId state between frontend and database to prevent
stale state issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Use scoped client token for blob uploads

Generate a short-lived, scoped client token instead of passing the
full BLOB_READ_WRITE_TOKEN to the sandbox. This mitigates token
exposure in shell commands and logs.

The client token is:
- Scoped to the specific snapshot pathname
- Valid for only 5 minutes
- Limited to 500MB uploads
- Restricted to gzip content types

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix snapshot restore failing for unpushed branches

For isNewBranch tasks, the branch only exists locally in the sandbox.
When restoring a snapshot, the code was trying to clone from that branch
which doesn't exist on origin, causing git clone to fail.

Now uses prNumber as a proxy for "branch exists on origin" - if no PR
was created, the branch was never pushed, so we clone the default branch
and create the new branch locally instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix chat route security and error handling

- Require taskId in chat route to ensure sandbox ownership is always verified
- Add JSON parse error handling for malformed request bodies
- Improve error message when blob upload returns non-JSON response

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 22:20:25 +00:00
Nico Albanese
beecf158e1
Add web app with Next.js UI and shared tool utilities (#62)
* initial web app scaffold

* update styles

* add streamdown

* update

* add deep agent and sandbox

* add renderers for tools

* add shared-context

* update agents md

* migrate to vercel sandbox

* update

* fix version mismatches

* update todos and better focusing

* update agents md

* update sandbox id storage for tool execution approval bug

* add abort

* update support for interruptions

* add support for expanding commands

* update agents md

* handle read tool approval

* code review suggested fixes

* suggested cc review fixes

* cc suggested fix
2026-01-11 17:16:56 +00:00
Nico Albanese
092beb9f24
chore: migrate to monorepo (#56) 2026-01-09 16:10:49 +01:00
Nico Albanese
64309217c9
Add just-bash sandbox implementation (#51)
* Add just-bash dependency to package.json

* Implement JustBashSandbox class

* Export JustBashSandbox from sandbox index

* Add type property to Sandbox interface

* Add type property to LocalSandbox

* Add type property to VercelSandbox

* Add just-bash sandbox type to factory

* Adjust agent instructions for just-bash sandbox
2026-01-08 16:07:34 +01:00
Nico Albanese
9b797efe12
Add sandbox support with Vercel integration (#48)
* Add vercel sandbox support to CLI

* Remove obsolete vercel sandbox test file
2026-01-08 14:57:02 +01:00
Nico Albanese
2f1aee6b98
Add code formatting and linting tools (#40)
* Add Biome and oxlint as dev dependencies

* Add Biome configuration file

* format

* lint

* add lint info

* Extract addTokens helper to module level

* Extract getTodoIcon and getTodoColor helpers

* Extract pad helper to module level

* Add oxlint configuration

* Enable React linting rules in oxlint config

* Move useMemo before early return in Suggestions

* Disable exhaustive-deps lint for intentional mount-only effect
2026-01-06 17:29:24 +01:00
Nico Albanese
885636813d
Add Vercel Sandbox integration with cleanup support (#18)
* Add @vercel/sandbox dependency

* Extend Sandbox interface with env and stop methods

* Support env vars in LocalSandbox

* Export VercelSandbox from sandbox module

* Add sandbox cleanup on agent finish

* Fix potential undefined array access in status bar

* add vercel sandbox and updated plan
2026-01-04 16:58:28 +01:00
nicoalbanese
23c63ee66f update name 2026-01-04 11:37:11 +01:00
nicoalbanese
105a66491f use anthropic and update dev tools 2025-12-28 10:01:09 +01:00
nicoalbanese
4b70bf0e13 add syntax highlighting 2025-12-26 22:09:38 +01:00
nicoalbanese
e7a42fe229 add md formatting 2025-12-26 22:01:15 +01:00
nicoalbanese
518c502906 working chat tui 2025-12-26 18:57:10 +01:00
nicoalbanese
6f9855110c add devtools 2025-12-26 13:07:04 +01:00
nicoalbanese
091de34668 init 2025-12-26 11:07:49 +01:00
nicoalbanese
69af5dc460 init 2025-12-26 10:52:12 +01:00