Adds a browser e2e that pins a session (while sitting on `/`, so it isn't
the active chat) and deletes it, asserting the "Pinned" section unmounts
in place — no reload.
Two harness details are load-bearing, and getting them wrong yields a
test that passes even against the buggy build:
- Delete a NON-active pinned session (page on `/`). Deleting the open
session navigates away and refetches; an active session also gets a
WS `removed`-frame reconcile. Either clears the row regardless of the
cache bug.
- Assert the "Pinned" SECTION disappears, not the row's href. While the
delete is in flight the row swaps to a hrefless "Deleting…" status row,
so an href-count assertion flickers to 0 during that transient and
passes spuriously; the section stays mounted until the pinned cache is
actually empty.
Verified it fails (~3s) against a build with the pinned-cache delete
patch removed, and passes with it.
Co-authored-by: Isaac
The inline rename row rendered a `text-sm` (14px) input inside a wrapper
whose `py-1` + `size-7` buttons summed to ~36px, while the interactive
row is `h-7` (28px) with the 13px `sidebar-compact-text` font. So
double-clicking to rename made the row grow taller and bump the font
size, an input visibly larger than the row it replaced.
Match the edit row's box metrics to the interactive row (h-7,
sidebar-compact-text, otto-sm radius) and drop the buttons to icon-xs
(24px) so they sit inside the 28px row, leaving only the muted edit
background to signal the mode.
Co-authored-by: Isaac
The in-flight "Deleting…" status row that replaces an interactive
conversation row used `text-sm py-2` with no height constraint, while
the interactive row uses `sidebar-compact-text h-7 py-0.5`. So starting
a delete didn't just recolor the row — it grew taller and changed font
size, shifting the surrounding list.
Match the deleting row's box metrics to the interactive row (h-7,
sidebar-compact-text font size, otto-sm radius) so the swap only changes
color/opacity.
Co-authored-by: Isaac
The Pinned section reads a sibling ["pinned-conversations"] cache that the
delete mutations' prefix-matched ["conversations"] sweep deliberately skips
(nesting it under that prefix breaks the pin-toggle's cache patch). That
isolation is by design, but it means the delete handlers must drop the row
from the pinned cache explicitly — which they didn't. So deleting a pinned
session removed it from the flat list but left it lingering in the Pinned
section until a full reload.
Mirror the unpin removal in all three delete paths (single-delete onSuccess,
bulk-delete onSuccess, and bulk-delete onError's partial-success branch),
patching the pinned cache in place rather than invalidating for the same
search-reindex-lag reason the list is patched in place.
Co-authored-by: Isaac
The scheduled server-compat matrix builds its default version set from
all tags, filtering only rcN. Dev/pre tags are snapshots of main, so
main-vs-them cells add no compat signal, and under the 256-job matrix
cap they evict the oldest final releases — the coverage the workflow
exists for. A stray v0.4.0.dev0 tag is already in the live matrix
today, and a nightly prerelease lane would add ~25 such tags a month.
Explicit VERSIONS dispatch overrides still accept prerelease tags.
Co-authored-by: Isaac
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
* fix(repl): don't report an Omnigent credential for ACP-backed sessions
acp / acp:<slug> / goose / qwen aren't in _HARNESS_FAMILY, so
default_provider_for_harness treats them as unmapped and falls through to
the configured anthropic/openai default. describe_active_credential then
hands back that provider's default_model and credential source, and both
the /model readout and the startup header render it as the active model.
But an ACP agent carries its own auth and picks its own model — the
executor only forwards a model at session/new when send_model_in_session_new
is set. So `omnigent run --harness acp:<agent>` confidently names a model
and an API key the session never touches.
Declines these harnesses at the resolver rather than the readout, so the
startup header stops fabricating too. The predicate reads the declared
capability record (ACP_SUBPROCESS + OWN_AUTH) instead of a hardcoded list,
so community ACP plugins are covered without further edits.
Signed-off-by: apeltekci <andrew@peltekci.com>
* fix(repl): scope the own-auth credential decline to acp/goose and keep overrides visible
The own-auth predicate wrongly included qwen: a harness mapped in
_HARNESS_FAMILY is provider-routed at spawn (_build_qwen_spawn_env injects
the configured openai-family default via
configure_agent_harness_with_provider, and QwenExecutor exports
OPENAI_BASE_URL / OPENAI_API_KEY / OPENAI_MODEL into the qwen subprocess —
see test_qwen_uses_openai_global_default), so its readout naming that
provider was truthful, and declining it fabricated "own auth" in the other
direction. The decline now applies only to unmapped ACP_SUBPROCESS +
OWN_AUTH harnesses (acp/acp:<slug>, goose, unmapped community ACP plugins).
The predicate is public now, so the REPL stops importing a private name,
and the manual acp:<slug> split is gone (canonicalize_harness already folds
it).
The own-auth readout also no longer claims an Omnigent-side /model override
does not reach the agent — model_env_keys() covers acp and goose, the
process manager respawns on a model change, and goose applies the override
as GOOSE_MODEL — and a live override is shown instead of hidden.
Tests: the resolver-level case now uses a key-kind openai default, the kind
the unmapped fallback actually fabricated (a subscription default was
already declined before the fix, so the previous case pinned nothing), and
new cases pin override visibility and qwen's provider-routed readout.
Co-authored-by: Isaac
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
---------
Signed-off-by: apeltekci <andrew@peltekci.com>
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
Co-authored-by: Dhruv Gupta <dhruv.gupta@databricks.com>
DELETE /auth/users/{user_id} checked whether another admin existed and
deleted the target in two separate, unlocked transactions. Two
concurrent deletes of two different admins could each observe the
other as the remaining admin, both pass, and both apply, leaving
the deploy with zero admins and no in-app recovery path.
Lock the current admin set before counting it (BEGIN IMMEDIATE on
SQLite, SELECT ... FOR UPDATE on other dialects) so the check and
the delete happen in one transaction. A concurrent delete of a
different admin now blocks until the first commits and re-observes
the up-to-date count instead of a stale one.
Signed-off-by: Nick Chakre <nickchakre18@gmail.com>
## Related issue
N/A
## Summary
Bump the Android module's `compileSdk` and `targetSdk` from 35 to 36 to meet
Google Play's requirement that apps target API level 36 by August 30, 2026.
This required updating the full Android toolchain:
- AGP 8.6.1 → 9.1.1 (AGP 9 has built-in Kotlin support)
- Gradle wrapper 8.9 → 9.3.1
- Gradle Play Publisher 3.12.1 → 4.0.0
- AndroidX dependencies to versions compatible with compileSdk 36 (e.g.,
`androidx.core` 1.18.0, `androidx.activity` 1.12.4, `androidx.webkit` 1.15.0)
- Robolectric 4.14.1 → 4.16.1
The `org.jetbrains.kotlin.android` plugin is no longer applied because AGP 9
bundles Kotlin compilation support. Build-script helper tasks that previously
used the Gradle `exec { }` DSL were switched to `ProcessBuilder` to stay
compatible with the new Kotlin/Gradle DSL scope, and `android.sdkDirectory`
was replaced with `androidComponents.sdkComponents.sdkDirectory`.
## Test Plan
Ran the full local Android build pipeline:
```bash
cd web/android
./gradlew :app:assembleDebug :app:lintDebug
./gradlew :app:bundleRelease
./gradlew :app:assembleDebugAndroidTest
```
All completed successfully and produced a debug APK, release AAB, and androidTest
APK with zero lint errors.
## Demo
N/A
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [x] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [ ] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [x] Manual verification completed
- [x] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Verified by running `:app:assembleDebug`, `:app:lintDebug`, `:app:bundleRelease`,
and `:app:assembleDebugAndroidTest` locally. The existing CI `android-bundle.yml`
workflow uses the Gradle wrapper and JDK 17, both compatible with the updated
toolchain.
## Changelog
Android app now targets Android 16 (API 36) to stay compliant with Google Play's
latest target API level policy.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
The repo migrated to a pnpm workspace (pnpm-workspace.yaml and
pnpm-lock.yaml at the root, packageManager: pnpm@11.15.1) but
setup.py's _build_web_ui still shelled out to 'npm install' / 'npm
run build' from inside web/. That path looked for a package-lock.json
that doesn't exist there (the lockfile is pnpm-lock.yaml at the
workspace root), so npm re-resolved from package.json alone and
hard-failed on the @lobehub/fluent-emoji@4.1.0 peer range
(react@^19 vs the pinned react@18.2.0) with ERESOLVE.
Migrate _build_web_ui to pnpm, matching deploy/databricks/build.sh
and the CI workflows (.github/workflows/e2e-ui.yml):
- Resolve pnpm via shutil.which('pnpm'), falling back to
'corepack pnpm' (corepack ships with Node 22+ and auto-pins the
version from package.json's packageManager field).
- Run from the workspace root (cwd=root), not web/, so pnpm uses
the committed pnpm-lock.yaml.
- 'pnpm install --frozen-lockfile --filter web' then
'pnpm --filter web run build' — exactly the CI commands.
--frozen-lockfile guarantees the build is reproducible and
resolves @lobehub/fluent-emoji against react@18.3.1 under the
workspace's strictPeerDependencies: false, avoiding the peer
conflict that broke npm.
Also enforce the Node.js 22 LTS floor up front via a new
_require_node_22 helper that fails fast with a dedicated, actionable
message if 'node' is missing or reports < 22 — instead of failing
deep inside the toolchain with an opaque error.
All existing skip/force env vars are preserved:
OMNIGENT_SKIP_WEB_UI=true (opt out), OMNIGENT_BUILD_WEB_UI=1
(force rebuild), skip-when-bundle-exists, skip-when-web-absent.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
## Related issue
N/A
## Summary
- Split `SandboxLauncher` into a layered hierarchy: `SandboxLifecycle`
(lifecycle + capabilities), `SandboxExecTransport` (run/put/stream/exec),
`SandboxHostLauncher` (abstract start_host), and `ExecModelHostLauncher`
(default start_host + run_background + materialize_workspace).
- `SandboxLauncher` is now a backward-compat alias for `ExecModelHostLauncher`.
- Migrated Kubernetes to inherit `SandboxHostLauncher` directly — it no
longer needs a fake `run()` that raises; the entrypoint-as-host model
(Pod boots running the host) has no exec transport at all.
- All 8 providers now declare an explicit `capabilities` property instead
of relying on class-var derivation.
- Updated the registry's `isinstance` guard to check `SandboxLifecycle`
(the common base) so both exec-model and entrypoint-as-host providers pass.
- Updated the Kubernetes test that asserted `run()` raises to assert the
method does not exist instead.
## Test Plan
```bash
uv run pytest tests/onboarding/sandboxes tests/sandbox tests/cli/test_cli.py tests/server -k managed -q
pre-commit run --files <all changed files>
```
All 780 selected tests pass and pre-commit is clean.
## Demo
N/A
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [x] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [ ] Manual verification completed
- [x] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Existing provider and CLI tests pass unchanged, confirming backward
compatibility. The Kubernetes test was updated to reflect that `run()` no
longer exists on the launcher. The registry test was updated for the
`SandboxLifecycle` guard message.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
A conversation id pasted with surrounding punctuation (e.g. a trailing
period) crashed `omni resume` with a raw StatementError traceback from
the local store's Uuid16 bind. Strip the punctuation a paste drags
along — none of it can be part of a valid id — and resume the id the
argument contains, canonicalized to bare hex so downstream consumers
never see a legacy spelling. Error only when no valid id remains.
Co-authored-by: Isaac
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
Add a `./gradlew recordScreenshots` task that captures four real-WebView
screenshots of the Android shell on a device/emulator, with zero manual
setup — Gradle starts and stops both the Vite dev server and an isolated
omnigent backend automatically.
Screens captured (app/build/screenshots/):
- server_select.png — native ConnectActivity (server-entry screen)
- home.png — SPA landing page (sidebar closed)
- session_list.png — SPA home with sidebar drawer open (?sidebar=open)
- session.png — session/chat page with a real seeded user message
How it works:
- startBackendServer: launches `omnigent server` in a throwaway mktemp
data dir (OMNIGENT_DATA_DIR/CONFIG_HOME/DATABASE_URI isolated from
~/.omnigent, no-auth on loopback), pre-registers examples/kimi_hello.yaml.
- seedDemoSession: POST /v1/sessions with an initial user message so the
session screenshot has real content.
- startWebDevServer: launches `node vite --host 127.0.0.1 --port 5173`
directly (avoids spawning npm/pnpm whose grandchild is hard to kill),
reuses an existing server if present. Vite proxies /v1 to the backend.
- Per screen: pm clear + pre-grant POST_NOTIFICATIONS, then drive the real
ConnectActivity → MainActivity flow via UI Automator (am instrument, not
AGP's connectedDebugAndroidTest which auto-uninstalls and deletes the
screenshot before we can pull), then adb pull the PNG.
- stopWebDevServer / stopBackendServer: tear down both + clean temp dir.
The test (ScreenshotTest.kt) is pure UI Automator (out-of-process, black-box):
it launches the app from the launcher, types the server URL (base + route
path) into ConnectActivity, taps Connect, waits for the floating switch pill
as the "shell is up" signal, then captures via UiDevice.takeScreenshot. The
session-list screen uses the ?sidebar=open query param (AppShell reads it on
mount to open the conversation drawer) since uiautomator can't see inside the
WebView to tap the toggle button.
Dependencies added (pinned to the AGP 8.6 / compileSdk 35 toolchain):
androidx.test:runner 1.6.2, :rules 1.6.1, ext:junit 1.2.1
androidx.test.espresso:espresso-core 3.6.1
androidx.test.uiautomator:uiautomator 2.4.0
Also sets testInstrumentationRunner = AndroidJUnitRunner.
Usage:
ANDROID_SERIAL=emulator-5554 ./gradlew recordScreenshots
open app/build/screenshots/*.png
Requires an emulator or unlocked device. The backend/Vite are fully managed
— no separate terminals needed.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
* fix(release): harden finalize, cut, and homebrew against the 0.7.0-cycle failure modes
- finalize: docs sweep is advisory (never blocks publish), untagged drafts
are rebound automatically, tag input is normalized
- release: bump-main gates in shell so CLI-dispatched boolean inputs cannot
silently skip the post-release main bump
- update-homebrew: defer inside PyPI's 24h --uploaded-prior-to window and
add a nightly catch-up that no-ops when the formula is current
- uv.lock: gitpython 3.1.50 -> 3.1.55 (clears 8 OSV advisories that tripped
the Security Scan on every lock-touching PR)
Co-authored-by: Isaac
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
* fix(images): serialize image builds and raise the build timeout to 120m
At the v0.7.0 cut the rc1 (21:51) and final (21:57) tag builds ran
concurrently under SHA-keyed concurrency, raced each other's layer cache
cold, and the final build died on the 60m job timeout — no v0.7.0 or
latest images until a manual re-run a day later. A single serialized
group lets the later build reuse the earlier one's layers; 120m gives a
genuinely cold build headroom.
Co-authored-by: Isaac
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
---------
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
N/A
This is the final npm -> pnpm migration step for the OSS repo.
- Adds `editors/vscode` and `deploy/cloudflare` to `pnpm-workspace.yaml` so
they use the root `packageManager: pnpm@11.15.1` and the shared
`pnpm-lock.yaml`.
- Removes the per-package `package-lock.json` files and deletes the now-obsolete
`scripts/normalize_package_lock_registry.py` hook/script.
- Merges the three remaining categories of build-script approvals into
`pnpm-workspace.yaml` (`@vscode/vsce-sign`, `esbuild`, `keytar`, `sharp`,
`workerd`) so `pnpm install` works at the workspace root.
- Migrates VS Code and release workflows to `setup-pnpm`:
- `.github/workflows/vscode-extension-release.yml`
- `.github/workflows/vscode-release-pr.yml`
- `.github/workflows/release-omnigent.yml`
- Updates the lockfile regen workflows to refresh `pnpm-lock.yaml` instead of
the old web-only `package-lock.json`:
- `.github/workflows/oss-regenerate-and-smoke.yml`
- `.github/workflows/oss-regen-on-comment.yml`
- Updates `editors/vscode/README.md`, `editors/vscode/PUBLISHING.md`, and
`deploy/cloudflare/README.md` to reference pnpm commands.
- Removes the deprecated `.github/actions/setup-node` composite action.
- `pnpm install --frozen-lockfile --filter omnigent-vscode` passes locally.
- `pnpm install --frozen-lockfile --filter omnigent-cloudflare` passes locally.
- `uv run pre-commit run --all-files` passes (after dropping the package-lock
registry hook).
- Inspected remaining `npm install` occurrences in workflows; the only survivors
are transient agent CLI installs (`@anthropic-ai/claude-code`,
`@openai/codex`) that are intentionally not tracked in the lockfile.
N/A
- [ ] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [x] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
- [ ] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [x] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
Verified the new workspace packages install from the frozen pnpm lockfile and
that the pnpm-only lockfile regen scripts produce a valid lock. The VS Code
workflow commands were checked against the package names/filters from
`pnpm-workspace.yaml`.
N/A
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
The linux_bwrap sandbox mounts a fresh procfs under --unshare-pid, but a
Lakebox microVM masks /proc so that mount returns EPERM and the sandbox
fails to start. That blocked linux_bwrap — and the L7 egress management
built on top of it — on the Lakebox backend.
Bind the existing /proc instead of mounting a fresh one, but only on
outer sandbox backends known to be safe for it (allow-list: lakebox).
The backend is read from OMNIGENT_HOST_SANDBOX_BACKEND when set, else
autodetected via the /run/lakebox marker. Everywhere else the fresh-proc
mount and its fail-closed behavior stay unchanged.
Binding /proc exposes the outer process list and world-readable per-proc
files (cmdline/comm/stat/status). The retained user namespace still
blocks ptrace-gated files (environ/mem/maps/fd) and --unshare-pid still
contains signalling, so the leak is acceptable on a single-tenant
Lakebox microVM.
Signed-off-by: Thomas Garnier <6202935+mxatone@users.noreply.github.com>
The kimi forwarder mirrored wire content but never posted an
external_session_status edge — the only native forwarder that didn't
(claude/codex/opencode/cursor all do). A kimi sub-agent therefore finished,
delivered its answer to the transcript, and left the parent waiting on it
forever: _mark_subagent_terminal_and_wake was never reached, so no result
ever landed in the parent's inbox.
kimi's wire has no turn.end row; its agent loop steps while step.end carries
finishReason 'tool_use' and stops on 'end_turn' (1:1 with turn.prompt across
every recorded session). Map that edge to external_session_status: idle,
carrying the turn's final assistant text — the runner delivers an empty
result when an idle edge forwards none.
Signed-off-by: apeltekci <andrew@peltekci.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* feat(harness): add NativeHarnessProvider seam foundation (PR 1.1)
First, additive step of Phase 1 of the modular native-harness registry
(designs/harness-modular-registry-proposal.md). Introduces the behavior
side-channel that later PRs will dispatch through; no hub is rewired yet, so
this changes no runtime behavior.
- Add `NativeHarnessProvider` (frozen dataclass of dotted import-path strings
for a native harness's lifecycle hooks) and the `native_providers` field on
`HarnessContribution`, plus `native_providers()` / `native_provider_for_key()`
accessors.
- Populate 11 built-in provider rows uniformly from the `omnigent.<key>_native`
module layout (`run_<key>_native`, `_materialize_<key>_agent_spec`, and the
`_auto_create_<key>_terminal` builder re-exported from `omnigent.runner.native`).
Hooks that are still runner closures / inline dispatch (interrupt, stop,
spawn-env, bridge-dir) stay None until those hubs migrate onto the seam.
- Add `omnigent/native_dispatch.py`: a lazy, per-path-cached resolver over the
existing `load_object`, with `resolve` / `resolve_hook` / `resolve_hook_for_key`
so hubs resolve a hook instead of branching on `key == "<x>"`. Import hygiene
preserved — provider rows hold strings; only the resolver imports the target
modules, and only at dispatch time.
- Tests: provider rows cover every native agent 1:1, required hooks are set, and
every populated built-in path actually resolves to a callable (guards against
a typo'd path or renamed symbol); resolver colon/dot forms, caching, and
unset-hook / unknown-key None paths.
The validator still rejects community native metadata (Phase 2 flips it).
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
* docs(harness): add implementation-progress ledger (PR 1.1)
Add an append-only "Implementation progress" ledger to the modular-registry
proposal so each PR in the stack records its own status without editing the
plan tables (which would conflict across the 1.1→1.2→1.3 stack on every
rebase). Seed it with 1.1 (#3239, in review).
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
---------
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
* 🔧 chore(lint): Block hardcoded model pins
Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
* 🔧 chore(lint): Tighten model baseline guard
- Reject duplicate path/model rows so baseline allowances cannot silently accumulate.
- Document heuristic false-negative and multiline-config gaps, plus the bounded full-scan tradeoff.
- Add focused coverage for duplicate baseline validation.
Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
* 🔧 chore(lint): Guard model scan configuration
- Cross-check the pre-commit trigger against the scanner's tracked roots, extensions, exclusions, and allowlist path to prevent silent drift.
- Share the source-extension set across path discovery and scanning.
- Report malformed allowlist counts with consistent path and line context; cover both review cases with focused tests.
Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
---------
Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
* fix(ui): sub-agent sessions never show reconnect modal when runner dies
A sub-agent session with a dead runner classified as local_stranded,
which disabled the composer and showed the CLI reconnect modal — a
flow designed for top-level host-bound sessions. Sub-agents have no
host binding and can't be relaunched from a CLI command; they recover
via their parent's live runner (server-side heal, #3151).
- Add kind field ("default" | "sub_agent") to Session type and
map it from the wire in sessionFromWire
- Thread kind through LivenessRow and livenessRowFromSession
- Add row 7a in useSessionLiveness: sub_agent with dead runner →
runner_asleep (composer open) instead of local_stranded
Fixes#3413
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
# Conflicts:
# web/src/hooks/useSessionLiveness.ts
* fixup: add kind and backgroundTaskCount to sessionsApi test fixture
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* test(e2e_ui): sub-agent dead runner keeps composer open, no reconnect modal
Regression test for #3413: a sub-agent session with a dead runner was
classified as local_stranded, showing the CLI reconnect modal and
disabling the composer. After the fix (kind=="sub_agent" → runner_asleep)
the composer stays enabled and the "Agent disconnected" banner is absent.
Creates a real child session (parent_session_id set → kind="sub_agent"),
patches the browser's health poll to report runner offline, and asserts
the composer is usable and no reconnect banner appears.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fixup: splice kind from session snapshot into livenessRow when sidebar conv present
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fixup: expose kind in SessionResponse so the UI can detect sub_agent sessions
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fixup: don't re-initialize session on heal — parent runner already hosts the child
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fixup: re-init session for native sub-agents, skip for SDK sub-agents
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fixup: regenerate openapi.json for kind field in SessionResponse
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fixup: update heal docstring + add SDK sub-agent no-init test
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* 🐛 fix(server): heal sub-agent stale runner_id on message-send
A sub-agent copies its parent's runner_id at creation and is never
repointed when the parent's runner is relaunched. The message-send path
returned a permanent 503 for any sub-agent whose runner had
idle-timed-out, even while the parent's replacement runner was healthy
(host_id is None short-circuits all existing relaunch paths).
- Extract _heal_subagent_runner_binding_via_parent from
_recover_subagent_status_forward_via_parent: walks the ancestor chain
(immediate parent → root), waits for the live runner tunnel, calls
replace_runner_id on the child, returns the live client
- Wire the heal into the message-send path after the managed-launch
rendezvous, guarded to kind=="sub_agent"; sets
_runner_needs_session_init=True so the child's harness is initialized
on the healed runner before dispatch
- Refactor _recover_subagent_status_forward_via_parent to delegate
binding repair to the shared helper (no behavior change for the
status-forward path)
- Add regression tests: heal succeeds, no-live-ancestor preserves 503,
top-level sessions not treated as recoverable children
Fixes#3067
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
# Conflicts:
# omnigent/server/routes/sessions.py
* fixup: rebase onto main, apply heal to routes_events.py, fix lint
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fixup: fix test payload format and monkeypatch targets for routes_events
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
The AI-agent workflows install the Claude Code / Codex CLIs with a bare
`npm install` after `cd`-ing into a workspace subdir (`.cc-cli` / `.codex-cli`)
that has no package.json of its own. npm then walks up to the nearest ancestor
package.json to resolve the project root.
Once a repo-root package.json was added, that ancestor became the repo root, so
the install landed in `${GITHUB_WORKSPACE}/node_modules` instead of the subdir.
The follow-up `node node_modules/@anthropic-ai/claude-code/install.cjs` (run from
the empty subdir) then failed with MODULE_NOT_FOUND, breaking Polly review,
issue/security triage, doc-sync, and the run-omnigent-agent action. The
`added 2 packages` line (claude-code has zero deps) was the tell that npm had
reconciled the root tree rather than an isolated install.
Install into `${RUNNER_TEMP}/omnigent-{cc,codex}-cli` instead — outside the
checked-out tree, so no ancestor package.json can ever capture the install. This
matches the pattern e2e-ui.yml and flake-stress-ui.yml already use.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
* ci: bump @anthropic-ai/claude-code 2.1.170→2.1.212
v2.1.170 has a corrupted npm cache entry on GitHub Actions runners
causing install.cjs to be missing after `npm install`. Bumping to the
current stable (2.1.212) forces a fresh fetch and clears the bad entry.
Also bumps the ci-deps/package.json pin (was 2.1.163) and the
run-omnigent-agent action default to keep everything consistent.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* ci: update pnpm-lock.yaml for claude-code 2.1.212
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Codex materializes its versioned plugin store (openai-curated templates,
browser, presentations, ...) into $CODEX_HOME/plugins/cache on session
start. Because codex-native points CODEX_HOME at a private per-session
home, codex re-materializes ~44 MB of identical plugin data into every
session — the dominant on-disk cost once the upstream logs_2.sqlite TRACE
bloat (openai/codex#28224) is fixed in codex >= 0.142.0.
Symlink plugins/cache from the shared source home into each private home,
mirroring the existing skills-symlink pattern. The cache is content-
addressed read-only reference data (verified byte-identical to the shared
copy), so unlike config.toml it needs no per-session isolation. Skipped in
minimal (title-sidecar) mode, which runs no plugins. Best-effort: a symlink
failure logs and lets codex repopulate its own copy.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
- Launch bare agy for Google OAuth and verify with agy models\n- Keep Gemini API-key setup available alongside native sign-in
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
Running a full workspace install without filters complained about ignored
build scripts for @anthropic-ai/claude-code, @google/genai, and protobufjs.
These come from the .github/ci-deps package and are legitimate; approving
them lets Scope: all 4 workspace projects
Already up to date
Done in 194ms using pnpm v11.15.1 / undefined
[ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL] Command "dev" not found at the workspace root run scripts
instead of erroring.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
* fix(claude-native): never launch a bare family alias a gateway rejects
A family alias (opus/sonnet/haiku/fable) selected on a provider config
whose tier has no ANTHROPIC_DEFAULT_*_MODEL pin is canonicalized by
Claude Code to an Anthropic id (e.g. claude-opus-4-8) that gateways
404, failing session start with "There's an issue with the selected
model". Resolve unpinned aliases to the provider's default model in
resolve_claude_native_model_selection, which launch, sticky handoff,
and /model injection all route through.
Also stop offering the static subscription alias rows to provider
configs with no pins: the picker now lists the one model the config is
known to route.
Co-authored-by: Isaac
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
* refactor: trim the unpinned-alias fix to its minimal form
Shorten the resolver docstring and the pin-less catalog fallback, drop
e2e assertions already implied by the single-row count, and fold the
three alias-passthrough regression tests into one.
Co-authored-by: Isaac
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
* fix(claude-native): scope alias remap to endpoints that reject canonical ids
Review feedback on the unpinned-alias guard:
- Only rewrite an unpinned family alias when the config routes through a
gateway/Bedrock endpoint; the Anthropic API (api.anthropic.com or no
endpoint override) resolves aliases natively, so API-key providers keep
their alias routing and the static picker catalog.
- Respect managed-settings tier pins: Claude Code applies them to the
spawned process, so a managed pin means the alias still routes.
- The runner's /model handler now resolves the session launch config
instead of reading the in-memory cache, so alias resolution survives a
runner restart (cold cache previously skipped the remap).
Co-authored-by: Isaac
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
---------
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
- Add .github/ci-deps to the root pnpm workspace so it uses the shared
pnpm lockfile and install machinery.
- Regenerate pnpm-lock.yaml entries for the e2e-ci-deps package.
- Replace npm install --ignore-scripts in ci.yml and flake-stress-e2e.yml with
pnpm install --frozen-lockfile --ignore-scripts --filter e2e-ci-deps.
- Update electron-build.yml to use setup-pnpm and filter installs for web and
web/electron.
- Update omnidev source so the local dev supervisor installs and runs Vite
with pnpm.
- Update developer docs (README.md, CONTRIBUTING.md, web/README.md,
web/electron/README.md, dev/omnidev/README.md, tests/e2e_ui visual/README.md
and COVERAGE_GAPS.md) to reference pnpm commands.
- Add a minimal root package.json with packageManager: pnpm@11.15.1 and remove
the explicit version from .github/actions/setup-pnpm so CI uses the same
source of truth.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
* fix(onboarding): detect agy settings.json as login fallback on macOS
On macOS, agy 1.1.7+ stores OAuth credentials in Keychain and writes
only ~/.gemini/antigravity-cli/settings.json (no oauth_creds.json).
The existing gemini_auth_has_credential() missed this and falsely
reported 'harness antigravity-native is not configured'.
Accept the existence of settings.json as a fallback signal when no
token files are found. This is safe because the caller
(resolve_native_antigravity_launch) uses it only for an informational
warning — agy always re-drives OAuth on first run regardless.
- Update gemini_auth_has_credential() with settings.json fallback
- Update docstrings to document the third detection path
- Update warning message in antigravity_native_launch.py
- Add unit test for settings.json-only detection
- Fix _GEMINI_DIR isolation in existing test
Signed-off-by: ElliotSun <elros1109@gmail.com>
* fix(onboarding): prove agy login via CLI, not settings.json existence
The macOS lockout this fixes is real: agy 1.1.7+ keeps OAuth in the
Keychain and writes no token file, so the file-only check reported
antigravity-native as unconfigured and connect.py refused to spawn a
runner for a user who was in fact signed in.
Accepting the bare existence of ~/.gemini/antigravity-cli/settings.json
as the fallback signal does not work, because omnigent creates that file
itself: the CLI launch path calls ensure_agy_feedback_survey_disabled
under the real home before agy starts, and build_agy_launch emits no HOME
override. One `omni antigravity` run therefore satisfied the credential
gate forever, on every platform — turning a hard launch gate into a
no-op and letting a runner spawn that dies on its first turn. That is
worst on headless hosts, where agy's OAuth prompt has no TTY.
Ask the CLI instead. `agy models` exits 0 only when signed in and reads
the credential wherever agy stored it, Keychain included, so nothing
omnigent writes can satisfy it. This mirrors ambient._claude_login_detected,
which already solves the identical Keychain split for Claude Code, and
reuses the probe harness_install already wires as the gemini family's
status command.
The fallback is gated on macOS: Linux writes a real token file, so its
absence is a true negative there and the fallback would only add a
subprocess while weakening a signal that works. Failures — missing
binary, non-zero exit, timeout, unreadable home — all read as False,
because readiness must never raise.
Content inspection of settings.json was the alternative considered. It
was rejected as unverifiable from here: no key in that file is known to
mark a completed sign-in on 1.1.7, so keying on one risks reintroducing
the very lockout being fixed.
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
* docs(skills): note agy's macOS Keychain credential in the e2e pre-flight
The pre-flight tells the reader agy's token lives under ~/.gemini, which
leaves a Mac developer on agy 1.1.7+ hunting for a file that is never
written. Name the Keychain case and the `agy models` fallback that
gemini_login_detected() now uses there.
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
---------
Signed-off-by: ElliotSun <elros1109@gmail.com>
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
Co-authored-by: SabhyaC26 <sabhyachhabria@gmail.com>
* fix(cursor-native): auto-accept lingering tool gates under --yolo
cursor-agent's Run Everything mode still sometimes leaves pendingToolCall
markers long enough for Omnigent to mirror ApprovalCards and stall a
piloted parent. When the session launched with --yolo/--force/-f, accept
those tool gates in-pane instead of parking a web card; AskQuestion still
surfaces as deliberate human input.
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Sam Armstrong <armstrongflg@gmail.com>
* fix(cursor-native): satisfy ruff format and PIE810 on yolo args
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Sam Armstrong <armstrongflg@gmail.com>
* fix(cursor-native): make yolo auto-accept bounded and fail-closed
Auto-answering a tool-approval gate is a safety boundary, so the accept path
now refuses to act on anything it cannot confirm, and always has a way out.
The accept was previously a blind keystroke loop: it never checked that a
prompt was on screen, recorded a send to a dead pane as a success, and had no
attempt cap or fallback. A gate that `y` does not clear therefore degraded from
a visible stall into a literal `y` typed into cursor's composer every two
seconds for the life of the session, with no card ever surfaced.
The accept key now goes out only while `capture_cursor_pane` shows cursor's
parenthesised accept hint, at most three times, and at most once per poll pass
(cursor renders one prompt at a time). A dead pane, a send tmux rejects, or a
gate still pending after the budget all fall back to the same ApprovalCard the
non-yolo path shows, so the worst case is the visible stall we have today.
Because a call accepted this way is never seen by a human, the INFO line now
carries an argument preview: it is the only record Omnigent approved the call.
`cursor_launch_args_enable_yolo` was failing open in the same spirit —
`--yolo=false` and `--force=false` both read as enabled, because only the
presence of the `=` form was checked. Explicit off-values are now honoured, and
a bare `--` ends the flag scan so a `-f` in the prompt text that follows is
text rather than a request to bypass approvals.
Tests cover the bounded retry, the fallback to a card, an idle pane, a dead
pane, an undelivered keystroke, an explicit non-yolo session, and the
off-value / end-of-flags argv cases. The design doc gains a section on the
fail-closed contract and drops its claim that Omnigent never sends a verdict of
its own initiative; its stale `Code:` pointer at the runner wiring is refreshed
to where that wiring now lives.
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
* fix(cursor-native): re-apply yolo wiring where auto-create now lives
`_auto_create_cursor_terminal` moved out of `omnigent/runner/app.py` into
`omnigent/runner/native/orchestration.py`, which left `app.py` a re-export
shell and this branch's wiring hunk applying to code that no longer runs.
Derive `auto_accept_approvals` from `launch_config.terminal_launch_args` at the
live call site instead.
This kwarg is the only thing that turns the in-pane auto-accept on, and it is
one line inside a large function, so a future move can drop it and leave the
feature inert with the whole suite green. Pin it: the auto-create harness now
captures the elicitation supervisor's kwargs, and a parametrized test asserts
the derived stance for `--yolo`, `--force`, `-f`, `--yolo=false`,
`--auto-review`, and no args. Deleting the kwarg fails all six.
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
---------
Signed-off-by: Sam Armstrong <armstrongflg@gmail.com>
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: SabhyaC26 <sabhyachhabria@gmail.com>
The runDebug, listDevices, and reverseProxy Exec tasks called
`commandLine("adb", ...)`, relying on adb being on PATH. The Gradle
daemon is long-lived and may have been started from an environment
whose PATH doesn't include platform-tools (e.g. homebrew's
android-commandlinetools), so the spawn fails with
"A problem occurred starting process 'command 'adb''" — even though
AGP's own installDebug succeeds because it resolves adb from the
SDK directory internally.
Resolve adb from android.sdkDirectory instead, mirroring AGP, so
the custom launch tasks are independent of the daemon's PATH.
* docs(DBSPEC): remove stale DBOS/tasks references
The tasks table and DBOS were removed (migration
b9c1d2e3f4a5_drop_tasks_table), but DBSPEC.md still described the
old DBOS-backed workflow design: the tasks table schema, the
try_deliver/close_inbox steering handshake, and the TaskStore
method mapping. Updated the doc to match current state — turn
state now lives in-memory in the runner (_active_turns,
_session_message_buffers), and conversation_items.response_id is
just an app-generated grouping id with no backing table.
Also added the created_by column to conversation_items, which
existed in code but was missing from the doc.
Signed-off-by: Harry Su <tiecheng.su@robinhood.com>
* docs(DBSPEC): correct FK section — no DB-enforced FKs, cleanup is explicit app code
Addresses the blocking review: the previous revision claimed an ON DELETE
CASCADE FK on conversation_items.conversation_id, but
p1a2b3c4d5e6_remove_all_fks dropped every FK (Rule R032) and
delete_conversation cleans up children before parent explicitly. Also
precision-fix response_id as harness- or app-generated per review.
Signed-off-by: Harry Su <tiecheng.su@robinhood.com>
* docs(DBSPEC): correct table count, deletion order, and position allocator
The accuracy pass left five claims that don't match the code:
- The opening line said four tables in the default schema. There are 17
in `db_models.py`, and none sets an explicit schema — the same doc names
labels, comments, and policies as tables a hundred lines later. Scope the
sentence to the four tables this doc covers and point at the models as the
full list.
- `delete_conversation` was described as deleting comments and policies
before the conversation rows. It uses two transactions: the AP one drops
FTS rows, items, labels, and the conversation rows; a second best-effort
transaction then cleans up comments, policies, session permissions,
conversation metadata, and session-scoped agents *after* the conversation
is gone. The doc also omitted three of those tables and hid the
best-effort tradeoff the method's own docstring calls out.
- "Turn state is not persisted to this schema at all" was overstated. The
authoritative state is in-memory, but `persist_live_status` mirrors
`live_status` / `pending_elicitation_count` onto
`omnigent_conversation_metadata` so any replica can render session status.
- The "Delete agent" row documented cancelling in-flight turns for the
agent's live sessions. No such mechanism exists: `AgentStore.delete` is a
bare row delete with no production caller and no HTTP route, and
session-scoped agent rows are removed by `delete_conversation`.
- The position allocator no longer runs `SELECT MAX(position) + 1`.
`append()` reads and advances the `conversations.next_position` counter
under `_lock_conversation`, keeping allocation O(1); the `MAX(position)`
scan survives only as a one-time backfill for pre-counter conversations.
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
---------
Signed-off-by: Harry Su <tiecheng.su@robinhood.com>
Signed-off-by: SabhyaC26 <sabhyachhabria@gmail.com>
Co-authored-by: SabhyaC26 <sabhyachhabria@gmail.com>
- Define a root pnpm-workspace.yaml with web/ and web/electron/ packages.
- Move npm overrides from web/package.json into workspace overrides, using a
shared catalog: for react, react-dom, and shiki.
- Preserve 7-day dependency cooldown via settings.minimumReleaseAge: 10080.
- Delete web/package-lock.json and web/electron/package-lock.json; add the
generated root pnpm-lock.yaml.
- Update web/electron/package.json scripts to use pnpm --filter web run build:overlay.
- Remove web/.npmrc and web/electron/.npmrc; no committed .npmrc (CI forces the
public registry via env var).
- Add .github/actions/setup-pnpm so all workflows can share a pinned pnpm
11.15.1 + Node setup.
- Convert lint.yml and web-tests.yml to pnpm; update ui-snapshot and e2e-ui
workflows.
- Update the web-prettier pre-commit hook to run web/node_modules/.bin/prettier
directly when present.
- Update justfile to prefer pnpm for Electron recipes and lockfile normalization.
- Ensure remaining npm-based workflows (editors/vscode/, .github/ci-deps/,
deploy/cloudflare/) are untouched and continue to work.
- Add pdfjs-dist worker URL import so Vite emits the worker asset under pnpm's
hoisted node_modules layout.
- Force shiki and its first-party packages into a single build chunk to avoid a
Cyclic top-level import that produced a 'flatMap' runtime error in Monaco.
- Pin build-tool versions to the legacy npm lockfile (vite 8.1.0, tailwindcss
4.3.1, jiti 2.7.0, lightningcss 1.32.0, postcss 8.5.15) so bundler behavior
stays consistent with the pre-migration builds.
- Update tests/e2e_ui/test_pwa_build.py to omit the now-incorrect -- separator
when forwarding --outDir to pnpm run build:embed.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
On a claude-native session with intelligent routing on, the routed model
was selected but the user's first message was silently dropped — the model
switched, no error surfaced, but no turn ran.
The server issued TWO unsynchronized writes to the same tmux pane: a
standalone model_change event (which typed /model <routed> into the pane)
AND, separately, the user's message (typed in via inject_user_message).
These raced. The message keystrokes landed mid-switch, inject_user_message
never saw its draft, hit its submit-blind fallback, and returned without
error. Model applied, message gone.
Fix: remove the second writer by folding the switch into the message turn,
mirroring how the SDK/pi path already applies the routed model as one
operation.
- Executor (ClaudeNativeExecutor.run_turn): the routed model already
arrives in ExecutorConfig.model and was being discarded. It is now
applied: when config.model differs from the pane's model, type /model
then inject the message — both under the existing _inject_lock, in
order, exactly once. inject_user_message's prompt-ready gate + verified
submit then guarantee delivery. _applied_model is seeded lazily from
read_launch_model so turn 1's routed pick is compared against the spawn
model rather than blindly re-issued.
- Server (_sessions/orchestration.py): the routed model rides in-band on
the message (model_override, an extra field the harness MessageEvent
forwards into ExecutorConfig.model), and the separate racing model_change
POST is dropped. The manual composer /model picker path (PATCH ->
model_change) is untouched.
Adds three executor tests: /model precedes the message in order under one
lock; no /model without a routed model; no /model when already on the
routed model. The ordering test fails against the prior discard-config
behavior.
Signed-off-by: Edwin He <41037314+Edwinhe03@users.noreply.github.com>
* Bump version to 0.8.0.dev0
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* chore(release): keep uv.lock at main's shape, stamp workspace versions only
The bump workflow's full relock rewrites every entry with new-uv metadata
churn; restoring main's lock and stamping just the workspace versions keeps
the PR reviewable. Workspace package blocks verified identical to the
relocked version.
Co-authored-by: Isaac
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
---------
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dhruv Gupta <dhruv.gupta@databricks.com>
* fix(codex): attribute per-model usage for turns with no pinned model
codex_executor's TurnComplete.usage never carried a "model" field, unlike
every other relay executor (claude-sdk, cursor, copilot, openai-agents,
pi). For a codex-harness agent that pins no llm.model (e.g. Debby's
gpt head, which deliberately defers to the harness/provider default),
_accumulate_session_usage's model-resolution fallback chain had nothing
to resolve to, so the turn's flat token/cost totals still accumulated
but session_usage.by_model silently never got an entry for it.
Stamp the turn's resolved model (already in scope as run_turn's `model`
argument) onto the usage dict extracted from tokenUsage/updated, mirroring
claude_sdk_executor's observed_model pattern.
Signed-off-by: Sato Taiga <antfgxgres@gmail.com>
* test(sessions): add regression test for codex per-model usage attribution
Exercises the real _accumulate_session_usage and GET /v1/sessions/{id}
API against a codex-harness agent with no pinned llm.model (Debby's gpt
head's exact shape): a usage delta with no "model" key still accumulates
the flat total but leaves by_model empty (the bug), while one carrying
"model" (as codex_executor.py now stamps it) gets a by_model entry that
also surfaces through the session snapshot the web UI's cost panel reads.
Signed-off-by: Sato Taiga <antfgxgres@gmail.com>
---------
Signed-off-by: Sato Taiga <antfgxgres@gmail.com>
N/A
- Added `min_version` and `max_version_exclusive` to `HarnessInstallSpec` and made `harness_cli_installed` probe `--version` when bounds are declared, so setup and dispatch fail loud for outdated CLIs.
- Implemented generic `--version` parsing + PEP 440 comparison with date-version normalization so Cursor and Hermes calendar-version strings compare correctly.
- Wired code- and changelog-derived version floors for all CLI-backed native harnesses (e.g. Claude >=2.1.161, Codex >=0.137.0, Cursor >=2026.06.02, Kimi >=1.47.0, Hermes >=2026.06.05).
- Updated the CLI setup overview and install prompt to show "Needs upgrade" and the detected/declared versions instead of claiming a present-but-outdated CLI is "not installed".
- Added the `version-too-low` readiness reason and surfaced it in the web UI badge/notice; also made Cursor native auth-aware so it now reports `needs-auth` when installed but not logged in.
- Fixed the readiness-layer lookup so `version-too-low` correctly surfaces for all native harnesses that declare a version floor (Claude, Cursor, OpenCode, Kiro, etc.) instead of falling back to `binary-missing`.
- Preserved the existing `antigravity-native` credential gate: an installed `agy` CLI without a stored Gemini credential still reports not-ready.
- Added E2E UI coverage for the new `version-too-low` warning and updated readiness unit tests for version-bound and credential-bound behavior.
```bash
uv run pytest tests/onboarding/test_harness_install.py \
tests/onboarding/test_harness_readiness.py \
tests/cli/test_configure_models.py \
tests/test_codex_native.py -q
npm run --silent test -- --run src/lib/harnessSetup.test.ts src/shell/NewChatDialog.test.tsx
```
N/A — the change is mostly backend/UX copy; no new visual components.
- [x] Feature
- [ ] Bug fix
- [ ] UI / frontend change
- [ ] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
- [x] Unit tests added / updated
- [ ] Integration tests added / updated
- [x] E2E tests added / updated
- [x] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
Manual verification: ran targeted backend/web test suites after each change and confirmed `omnigent setup`/`harness_cli_installed` now report “installed (vX) but not supported” rather than “missing” for outdated CLIs.
Native harness setup now checks the installed CLI version and prompts to upgrade if it is too old.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
The MITM egress proxy verifies upstream TLS against the system trust
store built by _system_ca_bundle(). It read only the consolidated
cafile (get_default_verify_paths().cafile/openssl_cafile) and ignored
the capath directory. Corporate MDM / IT-managed roots are commonly
installed as loose files under capath (with hashed symlinks) rather than
merged into the cafile, so they were missing from the proxy's trust
store. Any upstream host whose chain relies on such a root then failed
verification (e.g. a corp-intercepted github.com returned 502 from the
proxy) even though the host's own tools trusted it.
Read capath too: concatenate the loose PEM certs from the capath
directory onto the cafile bundle (dedup by resolved path, skip non-PEM
entries), keeping the certifi fallback when neither yields any certs.
Added tests: a CA present only as a loose capath file lands in the
bundle, and non-PEM files in capath are skipped.
Signed-off-by: Nishith Sinha <308961816+nhsdb@users.noreply.github.com>
Co-authored-by: Nishith Sinha <308961816+nhsdb@users.noreply.github.com>
Tools invoked by generic name (awk, python3, editor, pager, ...) resolve
through /usr/bin/<name> -> /etc/alternatives/<name> -> real binary. The real
binaries already live under the mounted /usr, but /etc/alternatives was not
bound, so the intermediate symlink node was missing inside the jail and the
lookup failed with 'command not found'.
Bind /etc/alternatives read-only in the default _DEFAULT_ETC_DIRS list,
alongside the existing /etc/ssl and /etc/ca-certificates dir binds. It is a
directory of symlinks (no secrets); read-only means the mapping cannot be
repointed, and every target is a binary already exposed under /usr, so this
grants no new capability -- it only restores standard name resolution.
Linux (bwrap) backend only; darwin_seatbelt is unaffected by this mechanism.
Signed-off-by: Nishith Sinha <308961816+nhsdb@users.noreply.github.com>
Co-authored-by: Nishith Sinha <308961816+nhsdb@users.noreply.github.com>
Native harnesses (claude-native / codex-native) report a cumulative
SESSION total, not a per-model split. `_persist_native_cumulative_usage`
SET each active model's `by_model` bucket to the whole running total, so a
session that switched models mid-run double-counted the shared baseline:
the previous model kept its last cumulative snapshot while the new model
was set to the full total, and summing the buckets exceeded the session
total (e.g. total $11.91 but opus $10.80 + sonnet $11.91).
Attribute only each report's growth (new - old) to the currently-active
model instead, mirroring the relay path's per-model delta accumulation.
Per-model token and cost buckets now hold each model's own usage and sum
to the flat session total across model switches. Deltas are clamped >= 0
so a lowered / rebased report never claws usage back out of a bucket (the
flat totals are likewise monotonic-clamped).
Read-only reporting (`omni usage`, the web session sidebar) needs no
change — it reads `by_model` verbatim, so corrected data flows through.
Existing sessions keep their already-stored buckets; this corrects
attribution for turns recorded after it ships (not backfillable).
Co-authored-by: Isaac
Signed-off-by: Jakub Majorek <majorek.jakub@gmail.com>
* feat(web): add a harness credential from the New Chat setup dialog (M3 frontend)
Frontend for Setup From the Web UI — turn a yellow needs-setup harness
green from the browser (Claude/Codex/Pi) via an inline equal-weight auth
form (adopt / subscription signpost / API key / gateway), plus the setup
dialog UX cleanups. Gated behind the existing harness_install_enabled cap.
Rebased onto latest main (the M3 backend #3088 is now upstream, so only
web/ + follow-up backend fixes remain) and folded in the Polly review
notes: stable option keys, clear secret fields on save, and a note that
default_model/wire_api are backend-accepted but reserved for a follow-up.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(web): scope useHosts refocus-refetch to the setup flow (Polly review)
staleTime:0 + refetchOnWindowFocus was app-wide across ~8 useHosts
consumers, bumping /v1/hosts volume on every refocus. Make it an opt-in
refetchOnFocus flag; only the setup dialogs (NewChatDialog, HarnessSetupDialog)
that need live readiness recovery pass it. Others keep the 30s stale window.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(web): guard the credential form against double-submit + close test gaps
Address Pat's review:
- Gate both form onSubmit handlers on !busy so hitting Enter in the field
during an in-flight save can't re-POST the secret (the Save button was
already disabled, but the keyboard path wasn't guarded).
- Add a double-submit-guard test, plus direct hook tests for
useStoreCredential (path/body split, JSON detail + non-JSON error parse,
cache patch + detect invalidation) and useDetectedCredentials
(GET/parse, empty-body fallback, enabled/host gating).
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(web): let Pi adopt an openai-family credential too (Polly review)
Pi consumes both anthropic and openai and the daemon adopts a detected
credential under its OWN family, so a host with only $OPENAI_API_KEY could
back Pi — but the adopt filter scoped to Pi's single write-default family
(anthropic), hiding that affordance. Add harnessCredentialAdoptFamilies
(Pi -> both families) and filter the adopt row on it; the paste/gateway
paths and the cross-family guard for Claude/Codex are unchanged.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
---------
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(codex-native): carry hook trust across private CODEX_HOME copy
When codex-native provisions a per-session private CODEX_HOME and copies
config.toml into it, the [hooks.state] keys inside the copy still reference
the global ~/.codex/ paths. Codex keys trust records by the absolute path of
the hooks file, so every key misses and Codex opens an interactive "Hooks need
review" prompt on every launch. Headless sub-agents can never answer it, so
the app-server never emits thread/started and the run dies on the 15s timeout.
Fix: two changes to _populate_codex_home_config:
1. Symlink hooks.json from the global home into the private home (alongside
auth.json). This makes the user's hooks reachable at the private path.
2. After copying config.toml, rewrite [hooks.state.*] key path prefixes from
source_dir to target_dir. The hash values are left untouched, so trust is
neither widened nor weakened — it is only carried across the copy that
Omnigent itself performs.
Fixes#3268.
Signed-off-by: Tomu Hirata <tomu@omnigent.ai>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: gate hooks.json symlink on not minimal_config; drop redundant re import
The minimal_config path rebuilds config.toml from scratch with only
model_provider/model_providers/profiles — no [hooks.state] entries.
Symlinking hooks.json there with no trust state re-introduces the
interactive trust prompt for the title worker. Gate the symlink (and
the trust-key rewrite that gives it meaning) on not minimal_config.
Also remove the redundant `import re as _re` inside
_retarget_codex_hook_trust_keys; re is already imported at module level.
Addresses Polly review feedback on #3343.
Signed-off-by: Tomu Hirata <tomu@omnigent.ai>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(codex-native): flush accepted hook trust back to global config on close
When a user accepts the hook-trust prompt inside a session, Codex writes
[hooks.state] entries into the per-session private config.toml — but those
are discarded when the session ends because the private CODEX_HOME is
ephemeral. So the prompt reappears on every launch.
Fix: in CodexNativeAppServer.close(), call _merge_codex_hook_trust_back to
read [hooks.state] from the private config.toml, translate the path keys
from the private home back to the global ~/.codex/ prefix, and upsert them
into ~/.codex/config.toml atomically. The next session's _populate_codex_home_config
copies the global config (now with the trust entries), and
_retarget_codex_hook_trust_keys translates the paths forward to the new
private home — so Codex sees the hooks as already trusted and skips the prompt.
The write is best-effort: any failure is logged as a warning rather than
raised, since the session has already ended.
Fixes#3268.
Signed-off-by: Tomu Hirata <tomu@omnigent.ai>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: assign tmp before try block to avoid unbound variable warning
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu@omnigent.ai>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(claude-sdk): surface ResultMessage is_error as ExecutorError, not assistant text
When the Claude SDK reports a harness-level failure (e.g. an expired
login or unauthenticated session), the terminal ResultMessage carries
is_error=True and the failure text in result. The executor was ignoring
is_error and assigning result directly to response_text, so the error
appeared in the conversation as though the model had said it — with no
error item, no harness attribution, and no log line.
Fix: check is_error before touching response_text. When true, set
terminal_error (the existing path that yields ExecutorError and returns)
and log an error line naming the agent. When false, the existing
response_text assignment runs unchanged.
Also add is_error to _ResultMessageObj so the Protocol matches the
SDK's actual shape (it was only declared on _ToolResultBlockObj before).
Closes#3282
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(claude-sdk): use getattr for is_error, handle null result, add unit test
Address Polly review feedback on #3342:
- Use getattr(result_msg, 'is_error', None) instead of direct attribute
access so that existing test doubles that only set session_id/result
don't raise AttributeError (matching the sibling getattr calls for
session_id and usage in the same block).
- When is_error=True but result is None/empty, fall back to a generic
'claude-sdk harness error' message rather than silently dropping the
failure.
- Add test_result_message_is_error_yields_executor_error: verifies that
a ResultMessage with is_error=True is routed to ExecutorError and does
not appear in TurnComplete.response.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(test): wrap long assertion string to satisfy ruff E501
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(web): stop short links collapsing table columns in chat markdown
Streamdown styles links with `wrap-anywhere` (overflow-wrap: anywhere),
which also drops the element's min-content width to a single character.
Inside its `table-layout: auto` table that let a link-only column be
squeezed to ~2ch, so a short link like "#3090" stacked one or two
characters per line while the prose columns took all the width.
Narrow links inside table cells to `break-word`: overlong URLs still
soft-wrap, but min-content stays at the longest unbreakable run so the
column can no longer be squeezed below it. Prose links keep `anywhere`.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
* test(e2e-ui): guard markdown table link column width in the browser
The CSS fix for the collapsing "PR #" column is only observable with a
layout engine, so the vitest companion can pin the rule and its selector
scoping but not the width. This adds the browser-side half: a seeded
assistant message renders the table shape that triggered the bug — a
link-only `#` column, wide prose columns, and a full-URL column — and
asserts the short link stays on one line box, its cell is at least as
wide as the link, and a long URL still soft-wraps inside its cell.
Verified against the pre-fix stylesheet: `#3090` stacks across 5 line
boxes without the `overflow-wrap: break-word` narrowing, 1 with it.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
---------
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
* fix(seatbelt): resolve two-hop proxy symlink when detecting CPython install root
When a Python interpreter is installed via `uv tool install`, the
executable is a two-layer symlink:
~/.local/share/uv/tools/<pkg>/bin/python → (proxy)
~/.local/share/uv/python/cpython-3.12.X-.../bin/python3.12
The literal proxy path grandparent (`tools/<pkg>/`) has no CPython
`lib/python*` markers, so `_interpreter_install_root` returned None.
`_add_topmost` then raised OSError before ever checking the resolved
path, causing every session to fail with:
darwin_seatbelt: helper interpreter at '.../uv/tools/omnigent/bin/python'
resolves under the unsafe ancestor '/Users'; ...
Fix: in `_add_topmost`, when the literal path yields no install root,
resolve it one level and retry `_interpreter_install_root` on the
resolved path before giving up. The resolved CPython install root
(which does carry the canonical markers) is then granted as the narrow
subpath, matching the existing behaviour for direct uv-python installs.
Also update the OSError message to say 'CPython install root' and note
that both the literal and resolved path were tried, and fix the
matching assertion in the existing test.
Fixes#3237.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(seatbelt): grant pi_dir and $TMPDIR write root so sandboxed pi can boot
Two follow-up fixes found by running `omnigent run --harness pi` with
darwin_seatbelt enabled end-to-end:
1. with_additional_read_roots silently dropped pi_dir
When the spec declares no read_paths, resolve_sandbox returns
read_roots=None (meaning 'no spec-supplied grants').
with_additional_read_roots bailed early on None, so the pi node_modules
dir granted by _try_sandbox_pi was never added to the policy. Result:
pi failed with 'Cannot find package .../pi-ai/index.js' because the
seatbelt profile had no subpath rule for the nvm install tree.
Fix: treat None as an empty list rather than 'already unrestricted' —
the caller is explicitly widening the policy and must be honoured even
when the spec has no grants of its own.
2. PI_CODING_AGENT_DIR was created under $TMPDIR, which wasn't granted
_try_sandbox_pi granted /tmp as a write root, but on macOS $TMPDIR is
/var/folders/.../T/ (not /tmp). PI_CODING_AGENT_DIR is created with
tempfile.mkdtemp() which uses $TMPDIR, so pi got EPERM trying to write
its extension/settings. Fix: also grant tempfile.gettempdir() alongside
/tmp.
With all three fixes (two-hop symlink detection, read-roots None handling,
TMPDIR grant) `omnigent run /tmp/pi-sandbox-bundle --harness pi` boots and
completes a full turn end-to-end under darwin_seatbelt.
Fixes#3237.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: route kimi and inkling through Responses API via system.ai.* ids
Kimi and inkling never send finish_reason in /chat/completions streaming
responses, causing Pi to throw 'Stream ended without finish_reason'.
These models work correctly via the Responses API at /ai-gateway/codex/v1
using their system.ai.* model ids (system.ai.kimi-k2-7-code,
system.ai.inkling).
- Add system.ai.kimi-k2-7-code and system.ai.inkling to
_DATABRICKS_RESPONSES_MODELS in the executor
- Add _DATABRICKS_TO_SYSTEM_AI mapping in pi_native_credentials so live
endpoint fetch translates databricks-* ids to system.ai.* and routes
them to the gpt_responses bucket (openai-responses at /ai-gateway/codex/v1)
- Update _pi_needs_responses_api to treat system.ai.* models as responses
- Update _pi_provider_for_model to route system.ai.* to databricks-openai
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(review): restore substring reasoning fallback and fix run-path translation
Addresses Polly's review of #3307:
1. Restore 'kimi'/'inkling' to substring reasoning check in _fetch_pi_model_lists
so unmapped variants (renamed/versioned endpoints not in _DATABRICKS_TO_SYSTEM_AI)
still get reasoning:true — preventing silent regression.
2. Translate databricks-* model ids to system.ai.* in the executor run path
(_build_env_and_dir) so model_override='databricks-kimi-k2-7-code' correctly
routes to the databricks-openai (Responses API) provider, not databricks-completions.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: move GLM to Responses API via system.ai.glm-5-2
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: move Qwen3 to Responses API via system.ai.* ids
Qwen3 returns array content with tool calls via /chat/completions causing
[object Object] errors. system.ai.qwen3-next-80b-a3b-instruct and
system.ai.qwen35-122b-a10b work correctly via the Responses API.
Also removes qwen3 from _unsupported_in_pi since it's now handled.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* refactor: replace hardcoded system.ai map with keyword-based detection
- Replace _DATABRICKS_TO_SYSTEM_AI exact-id dict with _databricks_to_system_ai()
function that detects by keyword (kimi, inkling, glm-5, qwen3, qwen35) and
derives system.ai.* id by stripping 'databricks-' prefix. Handles future model
variants automatically without needing to update an exact-id map.
- Apply the same swap in model_catalog._fetch_databricks_listing so sys_list_models
returns system.ai.* ids directly, letting the LLM use the correct id immediately.
- Use specific fragments (glm-5 not glm) to avoid false-positives like
zai-org-glm-4-7 which has no system.ai.* alias.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(review): fix _ensure_rpc selector translation; revert GLM to completions path
Addresses Polly's blocking issues:
1. Normalize model id to system.ai.* at the top of _ensure_rpc so that both
models.json and the provider/model selector see the same id. Previously only
_build_env_and_dir translated the id but _ensure_rpc still built the selector
from the untranslated databricks-* id, causing 'Model not found' in Pi.
2. Revert GLM (databricks-glm-5-2) back to the completions path. GLM works fine
via /chat/completions with finish_reason=true — moving it to the Responses API
was unnecessary and undocumented. Removed from _SYSTEM_AI_MODEL_KEYWORDS and
_DATABRICKS_RESPONSES_MODELS.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* refactor: use Unity Catalog model-services API for Pi model discovery
Replace /api/2.0/serving-endpoints with /api/2.1/unity-catalog/model-services
which returns system.ai.* model ids directly with supported_api_types metadata.
Benefits:
- No databricks-* → system.ai.* translation needed
- Authoritative API capability info: models with 'openai/v1/responses' in
supported_api_types go to the Responses provider; others to completions
- Embeddings excluded cleanly via has_embedding check
- sys_list_models returns system.ai.* ids directly via _fetch_databricks_uc_listing
Also add _ensure_rpc id normalization so databricks-* model_override values
are translated before building the provider/model selector.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: route all system.ai.* models through AI Gateway (omnigent-openai)
system.ai.* ids are not valid at /serving-endpoints — they only work
via the AI Gateway at /ai-gateway/codex/v1. Previously, system.ai.*
models without openai/v1/responses in UC metadata (kimi, inkling,
qwen3) were routed to omnigent-completions at /serving-endpoints,
causing 404 errors.
Route all system.ai.* models to omnigent-openai regardless of UC
supported_api_types.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(test): update test to expect all system.ai.* models in gpt_responses
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi-native): surface Pi model errors as visible error items in web UI
When Pi's API call fails (e.g. 404 for unknown model id, 400 for
unsupported API type), the extension was silently returning from
message_end with no output, leaving users with an empty turn.
Post an external_conversation_item of type 'error' when message.stopReason
is 'error', so the error appears in the web UI chat.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(tests): update model_catalog tests for Unity Catalog API format
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: revert Qwen3 from responses API - Pi sends fields that Qwen3 rejects
/ai-gateway/codex/v1/responses rejects Pi's standard Responses API fields
(parallel_tool_calls, temperature:null, top_p:null) for Qwen3, causing 400.
Route Qwen3 back to omnigent-completions until either:
- Pi adds compat flags to suppress these fields for non-standard providers
- The upstream array-content fix (earendil-works/pi#7062) lands to fix [object Object]
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: restore Qwen3 to Responses API path via system.ai.*
Pi only sends store:false in requests - the earlier 400 was from a stale
session before the routing fix. Confirmed minimal Pi request works fine
for Qwen3 via /ai-gateway/codex/v1/responses.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(review): scope UC listing to pi path only; fix test fixtures
Polly's review correctly identified that using _fetch_databricks_uc_listing
for all Databricks providers leaks system.ai.* ids to non-pi harnesses
(claude-sdk, codex, openai-agents) that only understand databricks-* ids.
Revert model_catalog.py to use _fetch_databricks_listing (serving-endpoints)
for sys_list_models. _fetch_databricks_uc_listing remains available but is
only used internally by pi_native_credentials._fetch_pi_model_lists.
Also fix test_model_catalog.py fixtures to use the correct serving-endpoints
payload shape (databricks-* ids) rather than the UC model-services shape
(system.ai.* ids) which the non-pi listing never emits.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* test(model_catalog): update pi tests for UC model-services API
Pi harnesses now call `/api/2.1/unity-catalog/model-services` and return
`system.ai.*` model ids instead of `databricks-*` ids. Update the test
fixtures and expected ids to match:
- `_databricks_transport`: now serves both the serving-endpoints page
(non-pi) and a UC model-services page (pi harness calls).
- `test_databricks_listing_filters_to_chat_llms`: expect `system.ai.*`
ids and matching family assertions.
- `test_databricks_listing_skips_explicitly_non_ready_endpoints`: rewrite
to use UC format (UC has no per-service readiness flag).
- `test_listing_failure_reported_and_not_cached`: switch to codex-native
harness to test generic failure/retry without UC routing complexity.
- `pi-everything` parametrize: update expected ids to `system.ai.*`.
- `model_catalog.py`: add TTL cache for UC listings (same `_listing_cache`
with a `"uc:"` prefixed key) so pi harness calls cache-hit correctly.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(model_catalog): fix ruff RUF005 and E501 lint errors
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(test_model_catalog): shorten docstring to fix E501
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi_executor): scope system.ai.* Responses-API routing to kimi/inkling/qwen only
system.ai.claude-* and system.ai.meta-llama-* ids should route to their own
providers (Anthropic surface and completions respectively), not the Responses
API. Previously _pi_needs_responses_api returned True for *all* system.ai.*
ids, which would have routed llama to the Responses endpoint.
Fix: check _SYSTEM_AI_MODEL_KEYWORDS in the system.ai.* branch so only kimi,
inkling, and qwen3 variants return True. Claude is already caught upstream by
the "claude" substring check in _pi_provider_for_model.
Also update stale docstrings in _needs_responses_api and _unsupported_in_pi
that still mentioned qwen3 as excluded (it was re-enabled via the Responses API).
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* feat(pi): route GLM via Responses API (system.ai.* ids)
GLM has the same finish_reason issue as Kimi/inkling on /chat/completions.
Route it through the AI Gateway Responses API by adding "glm-" to
_SYSTEM_AI_MODEL_KEYWORDS (uses "glm-" not bare "glm" to avoid matching
"zai-org-glm-4-7" which has no system.ai.* alias).
- Remove GLM from _PI_REASONING_MODEL_FRAGMENTS (reasoning:true is a
completions-path flag; not needed for Responses API).
- Remove GLM from the reasoning:true assignment in _fetch_pi_model_lists.
- Update test: kimi no longer gets reasoning:true (Responses API path).
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): remove gpt-oss from _unsupported_in_pi; it routes via Responses API
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): exclude all Gemini models from Pi, not just gemini-2-5
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): exclude only gemini-2-5 from Pi; other Gemini models use completions
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): drop redundant qwen35 keyword; qwen3 already matches qwen35 ids
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* refactor(pi): remove _databricks_to_system_ai; catalog always returns system.ai.* for pi
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): remove reasoning:true from kimi/inkling static model entries
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* feat(pi): route Gemini via /ai-gateway/mlflow/v1/chat/completions using system.ai.* ids
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): fix _unsupported_in_pi to only exclude gemini-2-5; gemini-3+ route via mlflow
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* refactor(pi): remove static kimi/inkling/qwen3 entries from _DATABRICKS_RESPONSES_MODELS
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): route system.ai.* llama/other models to mlflow gateway; rename provider to databricks-mlflow
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): use generic base URL for non-Databricks providers (OpenAI API key, LiteLLM)
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi): address Polly review — fix 4-tuple annotation, system.ai.gpt routing, gpt-oss exclusion, UC listing filter
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(model_override): strip system.ai.* prefix for vendor-direct providers (OpenAI key, etc.)
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
A native Pi session routed through a Databricks gateway whose OAuth token
can't be resolved (expired refresh token) launched fine but every message
silently failed to reach the model — no reply, no error. `_databricks_pi_provider`
caught all failures in one try/except and still returned a provider whose
`!databricks auth token` apiKey fails at request time; because pi-native
dispatches turns fire-and-forget, the failure never round-tripped back as an
Omnigent error.
Split credential resolution from the (benign) model-list fetch so a genuine
auth failure carries a `credential_warning`. At terminal auto-create, surface
that warning as an `error` item via `external_conversation_item`: it renders as
the web UI's distinct error banner (not a misleading assistant bubble),
persists across reload, is a non-content item type so it never enters the next
turn's context, and posts without queuing an agent turn (safe on a session
whose model is unreachable).
Co-authored-by: Isaac
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
Claude Opus 5 (released 2026-07-24) was missing from the curated
_SUBSCRIPTION_STATIC_MODELS["claude"] list. Verified empirically against
Claude Code 2.1.220: 'claude-opus-5' -> is_error:false; the dated form
'claude-opus-5-20260724' and a 'claude-opus-5-fast' variant both return
is_error:true, so neither is added.
Placement follows the existing convention: tiers descend
fable -> opus -> sonnet -> haiku, newest version first within a family
(matching claude-sonnet-5 ahead of claude-sonnet-4-6), so opus-5 slots
between fable-5 and opus-4-8.
The web mirror (web/src/lib/claudeNativeModels.ts) needs no change: it
lists version-agnostic aliases ('opus' resolves to the latest Opus) by
design, not pinned ids.
Signed-off-by: Abdullah Said <abdullahsaid89@gmail.com>
Co-authored-by: omnigent <noreply@omnigent.ai>
* ci(ui-snapshot): make the visual-baseline gate merge-blocking
The UI Snapshot visual-regression check was advisory ([non-blocking]) and
not in the required-checks set, so a UI change could land without
regenerating the committed baselines — which is how the baselines drifted
stale on main (every PR since #3311 fails the gate identically).
Register it as a required merge gate:
- Drop the "[non-blocking]" suffix from the job name.
- Add "UI Snapshot (visual baselines)" to REQUIRED and ALLOW_SKIP in
merge-ready/required.sh, plus a workflow_for mapping. It's safe as a
required check: a PR touching no render input skips the render via the
`detect` job's `if` gate, and an if-skipped job reports success — so
non-UI PRs satisfy the check instead of sitting pending. ALLOW_SKIP +
workflow_for let the gate tell that genuine skip from a still-pending run.
- Add "UI Snapshot" to merge-ready.yml's workflow_run triggers so the gate
re-evaluates when the snapshot workflow completes.
- Update the visual README's merge-blocking section.
This PR edits ui-snapshot.yml (a render input), so the gate runs here and
fails on the stale baselines; the `update-ui-snapshot` label regenerates
them onto this branch to turn it green.
Co-authored-by: Isaac
* test(e2e-ui): regenerate visual baselines
---------
Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com>
* fix(sessions): fall back to localStorage when pinning against an old server
A pin created in the new UI while the server is still pre-upgrade was lost
on the server upgrade. The pin toggle PATCHes `omnigent.pinned`; an old
server (no per-user pin concept) stores it as a bare label, but the
upgraded server's read path (`_labels_for_viewer`) drops every bare/
`omnigent.pinned.*` key and only surfaces the caller's own
`omnigent.pinned.<user>` key — so the bare-key pin silently vanishes. The
localStorage→server migration couldn't recover it either, since that pin
was never in localStorage.
This complements the earlier migration-gate fix (which protected pins made
*before* the UI upgrade). Now the toggle also checks `filterHonored`: when
the server can't store pins, it writes the pin to localStorage (the same
store the pre-upgrade UI used) instead of PATCHing a doomed bare key. The
pin renders immediately (sidebar unions localStorage pins) and later
migrates through `useMigrateLocalPinsToServer` like any pre-upgrade pin.
Once the server can store pins, the toggle uses the server as before.
- Move the legacy-pin localStorage helpers from Sidebar.tsx to the leaf
sidebarNav module (+ a single-id `setLegacyPinnedConversationId`) so the
toggle hook can use them without an import cycle.
- Tests: unit coverage for the toggle's old-server fallback (pin/unpin to
localStorage, no PATCH; normal PATCH path once honored), and an
end-to-end case in the backwards-compat suite that pins DURING the
UI-before-server window and asserts it survives the server upgrade.
Co-authored-by: Isaac
* fix(sessions): surface local-write failures in the old-server pin fallback
Addresses a review note: the old-server pin toggle's localStorage write is
the pin's only persistence, but it went through the best-effort
`writeLegacyPinnedConversationIds`, which swallows write errors (e.g.
storage quota exceeded). So a failed write let the mutation report success
and the optimistic patch show the pin, while it silently vanished on reload
— with no rollback.
Split out a throwing `...OrThrow` raw write. The old-server fallback
(`setLegacyPinnedConversationId`) now uses it, so a failed write rejects the
mutation → `onError` rolls back the optimistic patch and the UI honestly
shows the pin didn't take, matching the server PATCH path. The migration's
best-effort write is unchanged (a failed write there just retries next load).
Test: the fallback rolls back the optimistic pin when the local write throws.
Co-authored-by: Isaac
## Related issue
N/A
## Summary
- Add `omnigent/onboarding/sandboxes/types.py` with shared dataclasses
(`SandboxCapabilities`, `SandboxSpec`, `SandboxInfo`, `HostContext`) and the
new `SandboxError` exception hierarchy.
- Add `omnigent/onboarding/sandboxes/registry.py` with a contribution-based
provider registry that mirrors `omnigent/harness_plugins.py`: built-in
providers are declared as a `SandboxProviderContribution`, community
packages register via the `omnigent.sandbox_providers` entrypoint group, and
broken plugins are recorded in `load_errors` without breaking core startup.
- Add `omnigent/community/sandbox/__init__.py` as a namespace package so
third-party providers can ship code under `omnigent.community.sandbox.*`.
- Validation enforces that community provider code lives under the community
namespace, rejects name collisions, and checks metadata consistency.
- Add a `capabilities` property to `SandboxLauncher` that derives feature flags
from existing class variables and overridden transport methods.
- Migrate CLI and managed-host call sites from direct class-var reads
(`supports_cli_bootstrap`, `can_resume`, `supports_local_port_forward`) to
the new `capabilities` object.
- Add unit tests for types, registry behavior, validation, and entrypoint
discovery.
No provider implementations were changed; this is purely a surface-layer
refactor toward a pluggable sandbox provider interface.
## Test Plan
```bash
uv run pytest tests/onboarding/sandboxes tests/sandbox tests/cli/test_cli.py tests/server -k managed -q
pre-commit run --files omnigent/onboarding/sandboxes/types.py omnigent/onboarding/sandboxes/registry.py omnigent/onboarding/sandboxes/base.py omnigent/onboarding/sandboxes/__init__.py omnigent/onboarding/sandboxes/bootstrap.py omnigent/community/sandbox/__init__.py omnigent/cli_sandbox.py omnigent/server/managed_hosts.py tests/onboarding/sandboxes/test_types.py tests/onboarding/sandboxes/test_registry.py
```
All 779 selected tests pass and the targeted pre-commit hooks pass.
## Demo
N/A
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [x] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [ ] Manual verification completed
- [x] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
New unit tests in `tests/onboarding/sandboxes/test_types.py` and
`tests/onboarding/sandboxes/test_registry.py` exercise the registry,
contribution validation, types, and capabilities derivation. Existing
provider and CLI tests pass unchanged, confirming backward compatibility.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
* feat(scheduled): add Model + Reasoning-effort pickers to the task dialog
The scheduled-task create/edit dialog previously omitted model and effort,
sending only agent_id so tasks always ran with the agent's configured
defaults. Add lightweight Model + Reasoning-effort controls, gated by the
selected agent's capability exactly like the interactive New Chat dialog:
they render only for native coding agents that carry the model/effort
surface (Claude Code) and are hidden for agents without it (Codex, plain
SDK agents, etc.).
- New scheduled-local ModelEffortFields component reuses the shared option
lists (CLAUDE_NATIVE_MODELS + the version-agnostic aliases, and
CLAUDE_NATIVE_EFFORTS) rather than importing the 26-prop
HarnessConfigModal, which is bound to smart-routing / cost-control /
per-turn model loading and disproportionate for a saved task. When a host
is pinned it uses that host's live model options; with none pinned (the
common case) it falls back to the static Claude aliases.
- Hoist CLAUDE_NATIVE_EFFORTS into the shared HarnessConfigControls module
so both dialogs share one source of truth.
- Wire modelOverride + reasoningEffort through create and update (both
already round-tripped by scheduledTasksApi.ts — no client/API change).
Unselected ("Default") omits the field on create so the fire path uses
the agent's defaults; on edit, Default sends null to clear a prior
override. Edit mode prefills both controls from the loaded task.
No permission/approval/cursor mode picker and no new API field: this is a
pure frontend change.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* test(automations): e2e for model + effort selectors
Extend tests/e2e_ui/scheduled/test_scheduled_tasks_page.py with UI journeys
for the model + reasoning-effort selectors added to the scheduled-task
create/edit dialog:
- controls visible + default to "Default" for a capability-gated agent
(Claude Code)
- controls hidden (with the "uses defaults" hint) for a non-capable agent
(seeded Codex task, asserted via the edit dialog)
- create persists a concrete Model + Effort pick (asserted via the REST API)
- create with both controls left on Default persists null overrides
- edit prefills the controls from a seeded task's stored overrides
LLM-free like the sibling tests: exercises only the dialog, REST, and the
rendered row. Uses Playwright expect() auto-waiting, no sleeps.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
---------
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
## Related issue
N/A
## Summary
- Remove the dedicated Settings → Appearance → Sidebar → Font size card and the `lib/sidebarFontPreferences` module, since users should use the global Interface font size control instead.
- Clear the legacy `omnigent:sidebar-font-size` localStorage key on app boot so anyone who previously changed the sidebar font size falls back to the default 13px.
- Add a "Reset to defaults" button at the bottom of the Appearance section that opens a confirmation dialog and resets all appearance choices: mode, terminal theme, color palette/custom theme, workspace panel default, hide-unconfigured-harnesses toggle, and interface/code font size and family.
## Test Plan
- Updated unit tests in `web/src/pages/SettingsPage.test.tsx` covering the reset flow and the absence of the sidebar font size control.
- Added a Playwright E2E test in `tests/e2e_ui/sessions/test_appearance_reset.py` to verify the sidebar card is gone and the reset dialog restores defaults.
- To verify locally after installing web dependencies:
- `cd web && npm run type-check`
- `npx vitest run src/pages/SettingsPage.test.tsx`
- `pytest tests/e2e_ui/sessions/test_appearance_reset.py`
## Demo
N/A — UI change; a screen recording of the reset confirmation dialog is recommended before merge.
## Type of change
- [ ] Bug fix
- [ ] Feature
- [x] UI / frontend change
- [ ] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [ ] Integration tests added / updated
- [x] E2E tests added / updated
- [ ] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
local web dependencies are not installed in this environment, so the local type-check and vitest runs could not be executed. CI will run the web test suite on the PR branch.
## Changelog
Settings → Appearance no longer has a separate Sidebar font size control, and a new "Reset to defaults" button restores every appearance preference after confirmation.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
* feat(projects): name the project in the new-session hero, drop the tray chip
When starting a session from within a project (a `?project=` landing), the
composer used to show the project as a pill in the footer tray while the hero
kept its generic "What should we do?" prompt. Move that context into the hero
instead: the heading shows the project name and Otto's eyes are swapped for the
same folder icon the sidebar uses for a project. The footer project chip
(`LandingProjectPicker`) is removed — filing on create still uses the same
`selectedProject` state, just without the redundant chip.
The folder icon renders in a fixed-height (`h-18`) box matching Otto so the
vertically-centered composer doesn't shift when toggling between the plain and
in-project landings.
Co-authored-by: Isaac
* fix(projects): clamp long project name in the new-session hero
A 100-char project name (the server-side cap) rendered at text-3xl overflowed
the centered container: the icon+heading flex row sized to its content with no
width bound, so the h1's min-w-0/line-clamp had nothing to act against. Give the
row w-full and keep the heading min-w-0 + line-clamp-2 + break-words so a long
name wraps to two lines and ellipsizes instead of overflowing. Add a test
asserting the clamp class contract on a 100-char name.
Co-authored-by: Isaac
The same-second filename collision was disambiguated by pid alone. A pid is
only unique across processes — a process that crashed more than twice within
one second reused its own pid, so every report after the first collision was
written to the same path and silently destroyed its predecessor. Saving five
reports in one second left two files on disk with three crash reports lost,
with rotation held wide enough that nothing should have been pruned.
Keep counting past the pid-suffixed name until the path is free.
test_save_report_writes_and_rotates encoded the bug: it asserted all five
returned paths still existed while rotation kept only two, which could only
hold when the collision collapsed them onto two names. It now asserts the
newest report survives its own rotation pass, and a new test pins the
no-overwrite guarantee with rotation held wide.
Signed-off-by: apeltekci <andrew@peltekci.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Swap the Files right-rail tab glyph from FilePenLineIcon (pen-on-page) to
FilesIcon (stacked pages) to better convey the panel's contents.
Co-authored-by: Isaac
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
* fix(sessions): don't wipe local pins when UI upgrades before server
The one-time localStorage→server pin migration (#3189) trusted an
ambiguous success signal. A pre-upgrade server silently ignores the
unknown `?pinned=true` param and returns the normal (unfiltered) session
page, so the UI saw ~100 "server pins", computed an empty to-migrate set,
and cleared localStorage without ever writing a pin. After the server was
upgraded, its per-user key filter found nothing and every pin read as
unpinned — the reported data loss for UI-before-server upgrades.
Fix, entirely client-side:
- `fetchPinnedConversations` now returns `{ conversations, filterHonored }`.
It keeps only rows actually carrying the `omnigent.pinned` label and
reports `filterHonored: false` when the server returned unpinned rows —
the tell-tale of an old server that ignored the filter.
- The migration is gated on `filterHonored`: it stays inert (localStorage
untouched) against an old server and re-runs after the eventual upgrade.
A legacy id is dropped only after its write is confirmed.
- Pinned membership is the union of the server's pins and any leftover
localStorage pins, so a not-yet-migrated pin keeps rendering instead of
vanishing during the UI-before-server window.
Tests: new filter-honored detection cases, a migration-gate suite, and an
end-to-end backwards-compat test that drives the real hooks across an
old→new server upgrade and asserts the pin is never lost.
Co-authored-by: Isaac
* docs(sessions): address Polly review notes on pin migration
- Document the empty-page ambiguity in `filterHonored` and why it's safe
(an old empty page means a zero-session account; the migration PATCH to a
deleted session 404s and the pin is retained, not lost).
- Note the window-scoped caveat that a legacy-only pin outside the loaded
paginated window may not render a row until loaded.
- Add a regression test: a failed (404) migration write keeps the legacy
pin in localStorage for retry.
Co-authored-by: Isaac
* feat(automations): absolute next-run time + card rows
Change 1: the Automations list now shows the next run as an absolute
wall-clock time ("Next run Tomorrow at 8:00 AM" / "Today at 2:30 PM" /
"Jul 26, 8:00 AM") instead of a relative delta ("in 15h"). Adds
formatNextRunAtAbsolute() in scheduleText.ts, which only FORMATS the
server-authoritative next_run_at (rendered in the task timezone,
Today/Tomorrow bucketed in that same zone) and never recomputes which
instant is next on the client. The old relative formatNextRunAt() is
kept intact.
Change 2: each ScheduledTaskRow now renders as a card (rounded-xl
border bg-card, internal padding), and TasksPage stacks them with a
gap. All existing behavior and data-testids preserved; paused rows are
not dimmed.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* feat(automations): relative full-word next-run label
Reverses the earlier absolute-time next-run display back to a
server-sourced relative delta in full words ("Next run in 3 hours",
"Next run in 8 mins", "Next run in 2 days") per user feedback.
formatNextRunAt now emits full-word, pluralized buckets ('soon' /
'in N min(s)' / 'in N hour(s)' / 'in N day(s)'); the delta is still
computed only from the server's authoritative next_run_at, so the
"no client countdown" rule is unaffected. Removes the now-dead
formatNextRunAtAbsolute and its private helpers (safeFormat,
civilDayInZone). Card-row styling is unchanged.
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* fix(automations): live-tick the relative next-run label
The relative next-run label was frozen at its first-render `now` and
only refreshed on remount. A shared 30s useNow() clock (a module-level
singleton via useSyncExternalStore) now drives live re-renders, so the
delta counts down while the page stays open. TasksPage owns the one
ticker and passes `now` to each row, keeping the row a pure function of
props.
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* fix(automations): round next-run label to nearest unit
Flooring understated the relative next-run label near a unit boundary:
a task 1h49m away read "in 1 hour". formatNextRunAt now rounds to the
nearest minute/hour/day and promotes on carry (each threshold tests the
already-rounded value), so 1h49m reads "in 2 hours" and a delta that
rounds up to a full unit shows "in 1 hour"/"in 1 day" rather than
"in 60 mins"/"in 24 hours".
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* test(automations): e2e for live-ticking next-run countdown
Adds a Playwright test to the scheduled-tasks page suite proving the
relative next-run label re-renders on its own as time passes (the shared
useNow() ticker), with no navigation. Uses clock mocking for determinism:
pins the browser clock 40 min before the server's next_run_at, asserts
"Next run in 40 mins", fast-forwards 35 min past many 30s ticks, then
asserts the same row updated to "Next run in 5 mins". LLM-free.
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
---------
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
## Related issue
N/A
## Summary
- When `omnigent server` binds a non-loopback interface, it auto-enables accounts (login) mode and prints a warning.
- The warning now explicitly names `OMNIGENT_AUTH_ENABLED=0` as the override to keep single-user mode.
- Kept the warning to the canonical env var; removed any mention of the deprecated alias.
- Improved the rendered indentation so the override sentence starts on its own line.
## Test Plan
- `uv run ruff check omnigent/cli.py`
- `uv run pytest tests/cli/test_bind_auth_defaults.py -q`
Both pass.
## Demo
N/A
## Type of change
- [ ] Bug fix
- [x] Feature
- [ ] UI / frontend change
- [ ] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [ ] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [ ] Manual verification completed
- [x] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
The existing `tests/cli/test_bind_auth_defaults.py` already exercises the non-loopback auto-enable path and the explicit `OMNIGENT_AUTH_ENABLED=0` override. This change only updates the warning copy.
## Changelog
`omnigent server` now tells users they can set `OMNIGENT_AUTH_ENABLED=0` to override automatic multi-user mode when binding to a non-loopback interface.
## Related issue
N/A
## Summary
- Remove the long-deprecated `OMNIGENT_ACCOUNTS_ENABLED` environment-variable alias for the multi-user auth enable switch. The canonical name `OMNIGENT_AUTH_ENABLED` has existed since the repository was open-sourced.
- Strip the alias logic from `omnigent/server/auth.py::_auth_enabled()`, the explicit-auth check in `omnigent/cli.py::_apply_bind_auth_defaults()`, and the runner env-propagation allowlist in `omnigent/host/connect.py`.
- Delete the tests that exercised the alias and the obsolete comment in `tests/conftest.py`.
## Test Plan
- `uv run ruff check omnigent/server/auth.py omnigent/cli.py omnigent/host/connect.py tests/conftest.py tests/cli/test_bind_auth_defaults.py tests/server/test_accounts.py tests/e2e/test_local_server_lifecycle_e2e.py` passed.
- `uv run pytest tests/cli/test_bind_auth_defaults.py tests/server/test_accounts.py -q --no-header` passed (95 items).
- `uv run pytest tests/server/test_accounts.py::test_resolve_auth_source_defaults_to_header tests/server/test_accounts.py::test_resolve_auth_source_opt_in_selects_accounts tests/server/test_accounts.py::test_factory_defaults_to_header_when_env_unset tests/cli/test_bind_auth_defaults.py -q --no-header` passed (15 items).
- Verified no remaining references with `grep -R "OMNIGENT_ACCOUNTS_ENABLED" . --exclude-dir=.git --exclude-dir=.venv`.
## Demo
N/A
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [x] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [x] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [x] Manual verification completed
- [x] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Removed the tests that specifically covered the deprecated alias; remaining tests continue to validate `OMNIGENT_AUTH_ENABLED` behavior. The refactor does not change the `OMNIGENT_AUTH_ENABLED=1 | =0` semantics.
## Changelog
[Breaking] The deprecated `OMNIGENT_ACCOUNTS_ENABLED` environment variable has been removed; use `OMNIGENT_AUTH_ENABLED` instead.
BREAKING CHANGE: Users and deploys still setting `OMNIGENT_ACCOUNTS_ENABLED` must rename the variable to `OMNIGENT_AUTH_ENABLED` before upgrading; the old name is no longer read or propagated.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
Bring the Projects PRD implementation-status section in line with what has
shipped and what remains:
- Mark backend `config` hardening (size bound + non-dict coercion) as done —
both already landed in the project store.
- Move the completed Benchmark (#3094) and Phase 2 (project defaults) items out
of TODO into their own "Done" sections.
- Correct a stale claim that the new-session prefill machine still reads the
`omni_project` label — it was collapsed to config-only in Phase 2. The one
remaining UI label reader (the Settings archived-project picker) is folded
into the Phase 4 retire-label-path step instead.
- Postpone Phase 3 (memory & context) and Phase 4 (label consolidation) with
distinct triggers: Phase 3 waits for customer demand; Phase 4 waits until
telemetry shows most clients have migrated to a version that writes
`project_id`.
Co-authored-by: Isaac
## Related issue
N/A
## Summary
- Updated `inject_user_message()` in `omnigent/claude_native_bridge.py` so user messages that start with a Claude Code UI-only/unsupported slash command (`/help`, `/exit`, `/quit`, `/doctor`, `/cost`, etc.) are escaped before being pasted into the TUI.
- Escaping inserts an invisible zero-width no-break space before the leading `/`, causing Claude Code to treat the input as regular user text while the user still sees their slash.
- Supported slash commands (`/clear`, `/compact`, `/effort`, `/model`, `/ultrareview`, `/branch`, `/fork`) and unknown skill commands pass through unchanged.
## Test Plan
- Added parametrized unit test for `_escape_unsupported_slash_command`.
- Added payload test verifying `/help` gets the escape prefix and `/clear` does not.
- Ran targeted injection tests and pre-commit:
- `uv run pytest tests/test_claude_native_bridge.py::test_escape_unsupported_slash_command tests/test_claude_native_bridge.py::test_inject_user_message_escapes_unsupported_slash_command_payload -q`
- `uv run pytest tests/test_claude_native_bridge.py -k "inject_user_message" -q`
- `uv run ruff check omnigent/claude_native_bridge.py tests/test_claude_native_bridge.py`
- `uv run ruff format omnigent/claude_native_bridge.py tests/test_claude_native_bridge.py --check`
- `uv run pre-commit run --files omnigent/claude_native_bridge.py tests/test_claude_native_bridge.py`
## Demo
N/A
## Type of change
- [x] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [ ] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [ ] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
N/A — new unit tests directly cover the escaping decision and the payload path.
## Changelog
Unsupported Claude Code slash commands are now escaped and sent as regular user messages instead of leaving the native terminal in an undriveable state.
* fix(projects): disable settings inputs during config load; correct worktree doc
Two non-blocking follow-ups from the PR #3221 review:
- Gate the worktree toggle, workspace Browse trigger, and path input on
`isLoading`, matching the host Select. Previously an edit made in the load
window would be clobbered by the seeding effect once the fetch settled.
- Rewrite the `use_worktree` docstring to match the opt-in implementation
(only `true` is written; `false` is never stored and treated as unset).
Co-authored-by: Isaac
* docs(projects): mark backend config hardening as done in PRD
The two #3108 config-hardening follow-ups (size bound + non-dict coercion)
already landed in the project store; move them from "deferred" to a ✅ bullet
so the PRD status matches the code.
Co-authored-by: Isaac
* feat(projects): project settings editor + config-driven composer prefill (Phase 2)
Add a "Project settings" dialog to set a project's stored session defaults
(host, working directory, agent, opt-in random worktree) and wire the new-chat
composer to prefill from that stored config, retiring the newest-session
inference so stored config is the single source of truth.
- ProjectSettingsDialog: edit + persist config {host_id, workspace, agent_id,
use_worktree}; worktrees opt-in (default OFF, store true when on). Reuses the
composer's host/agent pickers and filesystem browser.
- projectPrefill: collapse to config-only seeding; unset fields fall through to
the composer's generic defaults. Honor a stored sandbox default via
selectSandbox (gated on managed sandboxes). Remove useNewestProjectSession.
- Extract the nested-dropdown dismiss guard into a dependency-free module shared
by the settings and scheduled-task dialogs.
Co-authored-by: Isaac
* fix(projects): repair CI — Sidebar test mocks, e2e rewrites, retire inference e2e
- Add useProjectConfig/useUpdateProjectConfig to all 10 Sidebar test mocks
(Sidebar now mounts ProjectSettingsDialog, which calls them).
- Rewrite the settings-dialog e2e to create the project via POST /v1/projects
instead of the flaky row-kebab move-to-project flow.
- Fix the composer-prefill e2e to stub GET /v1/sessions/projects (bare array),
the real endpoint useProjects hits.
- Remove test_start_session_project_prefill — it exercised the newest-session
inference path this PR retired; config-driven prefill replaces its coverage.
Co-authored-by: Isaac
* fix(projects): address review — no data-loss on failed config load; fresh prefill after save
Blocking issues from the PR review:
1. Data loss: saving the settings dialog after a failed config GET sent `{}`,
which the server reads as "clear stored defaults". Now `useProjectConfig`'s
isError is surfaced; a first-class project whose config failed to load blocks
Save (with a notice), the seed effect skips a blank draft, and onSubmit bails.
2. Stale prefill after save: useUpdateProjectConfig only invalidated, so the
composer's one-shot prefill could latch onto a stale cached config (30s
staleTime) and drop just-saved defaults. It now setQueryData's the fresh
config and upserts the projects list (so a promoted label-only folder
resolves to its new id immediately).
Tests: dialog load-error blocks Save; hook seeds config + upserts list on
success; useProjectConfig disabled on null id and surfaces isError.
Co-authored-by: Isaac
* fix(web): center sidebar header buttons and soften session row hover
## Related issue
N/A
## Summary
- Vertically center section header action buttons (Projects `+`, Sessions kebab, etc.) with their titles by using `top-1/2 -translate-y-1/2` instead of `top-0.5`.
- Remove the 1 px lift on session row hover (`motion-safe:hover:-translate-y-px`) so rows stay visually anchored.
- Calm the hover flash by dropping the bouncy Otto-token transition on rows and reducing the global `--sidebar-hover` tint from 5% to 3%. Rows now use the same plain `transition-colors` pattern as the rest of the sidebar hover surfaces.
- Make `SIDEBAR_ACTIVE_HIGHLIGHT` also specify `:hover` styles so active items (current page, selected session, drop target) keep their active background on hover instead of switching to the hover tint.
## Test Plan
- `cd web && npm install && npm run dev`
- Hover over Projects/Sessions headers and confirm action buttons are vertically centered with the title text.
- Hover over active items (e.g., current page in the top nav, selected session row, current Inbox) and confirm the background stays in the active state and does not flash.
- Hover over inactive session rows and confirm the row no longer shifts up and the background highlight is subtler.
## Demo
Subtle hover/positioning polish. Verify by hovering items in the sidebar — buttons align with title baselines, rows stay still on hover, and active items don't flash.
## Type of change
- [x] Bug fix
- [x] UI / frontend change
- [ ] Feature
- [ ] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [ ] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [x] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Visually verified by inspecting the relevant Tailwind classes and CSS variables. No test coverage changes; the existing `Sidebar.projectHeaderChevron.test.tsx` covers header layout, and the hover behavior is primarily CSS.
## Changelog
Sidebar header action buttons are now vertically centered with section titles. Session row hover is smoother, and active items no longer flash when hovered.
* test(e2e-ui): regenerate visual baselines
---------
Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com>
## Related issue
N/A
## Summary
- Replace the web-resolved-theme bridge with a single cross-shell contract, `setThemeSource(theme)`, so the web app only reports the user's chosen theme source and each shell drives its own OS-level dark mode.
- Android: `MainActivity` now extends `AppCompatActivity`; `OmnigentBridgeListener` maps `setColorScheme` to `AppCompatDelegate.setDefaultNightMode`; system-bar icon contrast is derived from `resources.configuration.uiMode`. Removes `ResolvedColorScheme.kt`, the root-class MutationObserver, and the top-level navigation reset on init.
- iOS: Add a `ThemeSource` enum and `ThemeController` singleton inside the existing `OmnigentWebView.swift` target file to avoid `.pbxproj` edits; wire `setColorScheme` through the JS bridge and apply it via `.preferredColorScheme(...)` and `window.overrideUserInterfaceStyle`.
- Web: Update `nativeBridge.setThemeSource`, remove the `omnigent-native-ready` queue, and update `ThemeProvider`/`nativeBridge` unit tests.
- Android and web unit tests are updated to match the new contract.
## Test Plan
- iOS: `cd web/ios && xcodebuild -project Omnigent.xcodeproj -scheme Omnigent -destination 'platform=iOS Simulator,name=iPhone 17 Pro' -configuration Debug -only-testing:OmnigentTests test`
- Android: `cd web/android && ./gradlew :app:testDebugUnitTest`
- Web: `cd web && npm install && npm run type-check && npm run test -- ThemeProvider.test.tsx nativeBridge.test.ts`
## Demo
N/A
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [x] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [x] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Manual verification completed for iOS: the app builds and `OmnigentTests` passes in the iPhone 17 Pro simulator. Android and web test suites were not run end-to-end in this session, but the affected unit tests were updated in the same change.
## Related issue
N/A
## Summary
- Add a top-level `justfile` that groups common local dev tasks (`run-ios`, `run-android`, `dev`, `electron-dev`, `lint`, `normalize-locks`, etc.) with hidden `_ensure-*` / `_check-*` prerequisites.
- Add an iOS `simulator` Fastlane lane that builds the Debug .app, installs it on an already-created iOS Simulator, and launches it.
- Add Android Gradle tasks (`runDebug`, `reverseProxy`) for launching the debug APK and running `adb reverse`.
- Fix the Fastlane `xcodebuild` invocation to use camel-case `derivedDataPath` so the built `.app` is written where the lane expects it.
- Export `FASTLANE_SKIP_UPDATE_CHECK=1` in the justfile.
- Document the new `justfile` recipes concisely in `AGENTS.md`.
## Test Plan
- `just --list` shows grouped recipes.
- `just run-ios` built/launched the iOS app in the iPhone 17 Pro Simulator.
- `pre-commit` passes on the touched files.
## Demo
N/A
## Type of change
- [x] Feature
- [ ] Bug fix
- [ ] UI / frontend change
- [ ] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [ ] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [x] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Verified manually by running `just run-ios` and watching the Omnigent app launch in the iOS Simulator.
## Changelog
Add a top-level `justfile` with recipes for launching the iOS Simulator, running the Android debug build, starting the omnigent dev pod, and running pre-commit/lockfile normalization.
* feat(web): 3D model preview for STL / 3MF / OBJ files
Selecting an .stl / .3mf / .obj file in the Files browser now renders an
interactive WebGL preview (orbit/zoom/pan) instead of the "Preview not
available for binary files" placeholder.
- Add `isModelFile()` to codeViewerHelpers (MIME-first, extension fallback),
scoped to exactly STL/3MF/OBJ.
- New lazy-loaded `ModelViewer` component (three.js STLLoader/3MFLoader/
OBJLoader) with camera + OrbitControls, lighting, auto-fit, loading/error
states, and full scene teardown on unmount.
- Dispatch models before the binary-rejection branch in CodeViewer; treat
them like images in FileViewer (diff/source-mode suppressed).
- three.js pinned at 0.185.1 and code-split into its own chunk so it stays
out of the main bundle.
Co-authored-by: Isaac
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(web): address model-viewer review — unified resolver, recovery, teardown
Resolve the four blocking issues from cross-vendor review of the 3D model
preview:
1. Unified format interface: add one shared `getModelFormat(path, contentType)`
resolver (MIME-first, extension fallback) used by BOTH `isModelFile`
dispatch and `ModelViewer`'s loader selection, so a MIME-matched file with
an unknown extension parses via the correct loader instead of erroring.
`isModelFile` is now `getModelFormat(...) !== null`.
2. Error state no longer unmounts the canvas: the container is always mounted
and the error is an overlay on top, keeping the ref alive so an
invalid→valid prop change recovers.
3. Single idempotent `teardownScene()` called from both the init failure path
and the effect cleanup, so a partial init (renderer/controls/context/RAF)
can't leak on failure.
4. Empty/degenerate models (e.g. comment-only OBJ) are validated for a
non-empty, finite bounding box before fitting; invalid bounds route to the
error UI instead of a blank canvas.
Adds ModelViewer.test.tsx (MIME-only loader selection, malformed/empty/NaN →
error, invalid→valid recovery, failure-path + unmount teardown) and
getModelFormat unit tests.
Co-authored-by: Isaac
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* feat(web): theme-aware 3D model preview (light/dark)
ModelViewer previously hardcoded a neutral STL material, fixed light
intensities, and a transparent canvas, so the 3D preview ignored the app
theme. Make it theme-aware off the SAME next-themes source Monaco and the
terminal use (`useTheme().resolvedTheme`), so it tracks light/dark and
updates live when the user toggles the theme with a model open.
- Add a pure `modelViewerTheme(resolved)` map in codeViewerHelpers (mirrors
`resolvedThemeToMonaco`): background clear color, STL default material, and
ambient/key light intensities per mode — brighter lights in dark so the
mesh stays legible. Shared across STL/3MF/OBJ in the one unified pipeline.
- ModelViewer seeds the scene from the active mode and keeps light/material
handles on its resource bag so a theme toggle recolors the live scene in
place (clear color + intensities + STL color) with no reload/reparse.
- Drop the transparent (alpha) canvas in favor of a theme-derived opaque
background so the preview sits flush with the panel in both themes.
- Tests: three theme-awareness cases (light build, dark build, live toggle
without rebuild) mirroring the next-themes mock pattern in
MonacoCodeEditor.test.tsx, plus modelViewerTheme unit tests.
Co-authored-by: Isaac
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* test(web): 3MF MIME-only dispatch + prune package-lock churn
Add MIME-only 3MF coverage mirroring the existing STL/OBJ tests: a file
with an absent/unrecognized extension but a `model/3mf` content type must
resolve to the 3MF loader in ModelViewer and route to <ModelViewer> in
CodeViewer, exercising the shared getModelFormat() resolver.
Regenerate web/package-lock.json so the diff vs origin/main is limited to
the `three` dependency subtree — dropping unrelated resolved-URL
normalization churn from an earlier regen.
Co-authored-by: Isaac
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(web): dispose material textures in ModelViewer teardown
disposeObject() freed each mesh's geometry and material but not the
textures the material references (map, normalMap, roughnessMap, …), so a
textured 3MF leaked its GPU textures every time the viewer unmounted.
three.js frees neither the material nor its textures automatically.
Add disposeMaterial(), which disposes every texture slot on a material
(detected via the three.js `isTexture` flag, robust to multiple three
copies) before disposing the material itself. Extend the ModelViewer
teardown unit test with a textured-material mesh and assert its textures
are released on unmount.
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* test(e2e): cover 3D model preview in the Files browser
Add a Playwright e2e test that seeds an ASCII STL and an OBJ file, opens
each in the Files browser, and asserts the ModelViewer mounts: the
`3D preview of …` canvas host renders a <canvas>, the "Unable to render
3D model" overlay never shows (so parsing and WebGL both succeeded), and
the flow does NOT fall through to the binary placeholder or a source
view. STL exercises MIME-based routing (application/vnd.ms-pki.stl); OBJ
exercises the extension fallback. Seeded via the filesystem PUT endpoint
(no agent run), mirroring the existing image/pdf rendering e2e tests.
This satisfies the E2E UI Required gate for the model-preview feature.
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(web): resolve the 3D-viewer deps from the public npm registry
The three.js stack this PR added (three, @types/three,
@dimforge/rapier3d-compat, @tweenjs/tween.js, @types/stats.js,
@types/webxr, fflate, meshoptimizer) was locked with `resolved` URLs
pointing at an internal mirror (npm-proxy.dev.databricks.com), while the
rest of package-lock.json resolves from registry.npmjs.org. Public CI
can't reach that mirror, so `npm ci` timed out fetching
three-0.185.1.tgz (ETIMEDOUT) and failed the install-dependent checks.
Repoint just those eight `resolved` URLs to the canonical
registry.npmjs.org form. Integrity hashes are unchanged (the mirror
served identical tarballs), so this only changes where the tarballs are
fetched from, not what is installed. `npm ci --legacy-peer-deps` now
succeeds from a clean node_modules, and `npm install --package-lock-only
--legacy-peer-deps` produces no further diff, so the lockfile-up-to-date
gate stays green.
Signed-off-by: Bryan Li <bryan.li@gmail.com>
---------
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(android): honor system dark mode
Signed-off-by: Bryan Li <15131870+btli@users.noreply.github.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(android): sync system bar contrast
Signed-off-by: Bryan Li <15131870+btli@users.noreply.github.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(android): harden resolved theme sync
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* refactor(android): decode theme at bridge boundary
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* test(android): tighten theme bridge coverage
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(android): drop WebView algorithmic darkening
Algorithmic darkening inverts the SPA when the user forces light mode
while the OS is dark: the page's root color-scheme is then 'light', so
WebView treats it as dark-unaware and darkens it algorithmically,
leaving dark status-bar icons over a darkened page. With targetSdk >= 33
the DayNight host theme alone makes prefers-color-scheme track the OS,
so the darkening flag added nothing for the system-mode path and only
broke the forced-light path. Verified on an API 34 emulator across the
OS-light/dark x app-System/Light/Dark matrix.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(web): keep Electron on the selected theme, not the resolved one
Reporting only resolvedTheme regressed Electron system mode: an explicit
Light selection under a light OS changes no resolved value, so no report
fired and themeSource stayed 'system' — the shell chrome then flipped
dark with the OS while the app was forced light. Report the resolved
scheme first (Android system-bar contrast) and follow with 'system'
while that is the selection: Electron keeps the last report, so it
tracks the OS in system mode and pins to explicit selections, including
ones that leave resolvedTheme unchanged. Android drops 'system' at the
bridge, so its behavior is unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix: route native themes by consumer
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(android): harden system bar theme sync
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* test(android): clean up theme bridge state
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(android): install theme bridge at document start
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(android): resync system bars on live theme changes
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* style(android): format theme test
Signed-off-by: Bryan Li <bryan.li@gmail.com>
---------
Signed-off-by: Bryan Li <15131870+btli@users.noreply.github.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
Co-authored-by: Bryan Li <15131870+btli@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
github-release.yml fired on every v[0-9]* tag push and created an
unpublished DRAFT release for rc/dev/alpha/beta tags. Nothing downstream
depended on those drafts — draft-release-notes.yml already skips rc,
finalize-release.yml refuses rc, and the Docker/homebrew/changelog
workflows fire on the tag push / release:published directly. The drafts
just accumulated (and rehearsal rcs had to be gh-release-deleted during
cleanup).
Add a guard that skips the draft-release job for rcN/devN/preN tags
(trailing digit required so a substring like 'dev' in a mistyped tag can't
trip it). Drop the now-dead alpha/beta arms — this repo only cuts rc
pre-releases — and align the same rc/dev/pre pattern + comments across
the other release-adjacent workflows for consistency. Update release.yml's
Next-steps text and RELEASING.md accordingly.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
## Related issue
Closes #[F-CR-7]
## Summary
- After a user consents to an unknown server (deep link) or types a server URL, `WorkspaceURLExpander.expandIfNeeded` issued a HEAD probe via `URLSession.shared` with no redirect policy, so the consented host could 3xx-redirect the probe to a different origin — including a local-network service — breaking the consent alert's promise that the app only talks to the host the user approved.
- The probe now defaults to a dedicated `URLSession` backed by `SameOriginRedirectHandler`, a `URLSessionTaskDelegate` that follows only same-origin redirects (scheme + host + port match) and blocks any cross-origin redirect by returning `nil` from `willPerformHTTPRedirection`.
- As defense in depth, `expandIfNeeded` additionally verifies `response.url`'s origin matches the approved origin, so a cross-origin response is never trusted even if a caller supplies a bare session without the redirect delegate.
- Rebased onto #3179 (F-CR-6) and deduped: removed my `--omnigent-deep-link` test hook (subsumed by #3179's `--omnigent-open-url` / `--omnigent-reset-state` seam), and consolidated the two `MockHTTPServer` copies into one shared file compiled into both test targets.
## Test Plan
- Unit: `WorkspaceURLExpanderTests.testRejectsResponseFromDifferentOrigin` returns a `server: databricks` 200 whose `url` is a different origin and asserts the URL is left unchanged.
- Integration (simulator, real local HTTP network): `WorkspaceURLExpanderRedirectTests.testBlocksCrossOriginRedirect` / `testFollowsSameOriginRedirect` assert a cross-origin redirect is blocked (response stays 302 on the approved port) and a same-origin redirect is followed. Confirmed meaningful: the cross-origin test fails when the delegate is reverted to follow-all-redirects (the vulnerable behavior).
- UI (simulator): `RedirectConsentUITests.testDeepLinkConsentOpensApprovedServer` drives the deep-link consent flow via #3179's `--omnigent-open-url` + `--omnigent-reset-state` seam and asserts the alert appears, "Open" loads the approved server's WebView.
- Ran on iPhone 17 simulator: all 8 expander/redirect tests + the UI smoke test + all 26 F-CR-6 deep-link tests pass; full project builds.
- Note: the UI test cannot exercise the redirect itself — a localhost deep link infers `http`, and the probe is https-only, so the probe never fires for loopback. The redirect policy is verified over a real local network by the integration test instead.
## Demo
N/A
## Type of change
- [x] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [ ] Refactor / chore
- [ ] Docs
- [x] Test / CI
- [ ] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [x] Integration tests added / updated
- [ ] E2E tests added / updated
- [x] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Manual verification: built and ran the new unit, integration, and UI tests on the iPhone 17 simulator; confirmed all pass and that the integration test fails against the vulnerable (follow-all-redirects) baseline, proving it is a meaningful regression test. Also ran all F-CR-6 tests after the dedup to confirm no regression from #3179's shared seam.
## Changelog
The iOS app no longer follows cross-origin redirects when probing a newly approved server for the Databricks workspace mount, so a consented host can't redirect the probe to a different origin.
* test: stabilize two known flakes (dictation close, agent-info popover)
Two load-timing flakes that recur across PRs:
- Pytest (server-rest) test_dictation.py::test_stream_closes_take_on_
abrupt_disconnect: on an abrupt disconnect the route offloads
handle.close() to a thread. During teardown the loop's thread-pool
executor may already be shutting down, so the offload raises and the
old contextlib.suppress swallowed it — the take (and, for the remote
engine, a worker slot) leaks. Fall back to a direct close() on the
loop; it's a quick non-blocking free for every engine.
- E2E UI test_agent_info_popover.py: _open_popover single-clicked the
trigger, but the button hover-opens on the click's own pointer arrival
and the click's Radix toggle can flip it back shut past the
HOVER_CLICK_GRACE_MS window under load, so the panel never mounts.
Confirm the panel opened and retry the click from a closed state.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
* test: stabilize scheduled-tasks time-picker flake
test_scheduled_task_create_edit_modal_and_time_picker had two coupled
races in the time-picker step (6/10 failures reproduced, no artificial
load needed):
- The picker is a Radix popover nested in the create-task dialog. The
dialog's focus management can fire an interaction-outside that closes
it the instant it mounts, so the minute cells unmount between the
visibility check and the click (element-not-found / click timeout).
- Selecting a minute leaves the popover open, and an open floating-ui
popover keeps recomputing its position — so the submit button (and,
later, the edit-phase time input) stays perpetually "not stable" and
detaches mid-click.
Extract a _pick_minute() helper that opens from a known-closed state and
retries until the cell is present, then dismisses the picker via a
click-outside (not Escape, which would bubble to the Radix Dialog and
close it) and waits for it to unmount so the layout settles before
submit. 0/12 clean + 0/8 under load after the fix.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
---------
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
The in-session "Configure" model dropdown offered a "Smart Routing" option on
native terminal sessions (Claude Code, Codex, Pi, …). It's meaningless there:
a native CLI bakes its model into the launch argv once and can't per-turn
route, so picking it did nothing useful.
Add isNativeTerminalSession() (mirrors the server's
_native_coding_agent_for_session: native by omnigent.wrapper label OR resolved
harness) and exclude such sessions from costRoutingEligible in ChatPage, so the
Smart Routing option no longer appears in their Model dropdown. Brain-harness
sessions (claude-sdk / codex / pi, and the polly orchestrator) keep it.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* feat(scheduled tasks): add windowed latest-run-status store query
Add ScheduledTaskStore.list_latest_run_status_for_tasks(ids) -> {id: status},
a single row_number()-windowed query (scheduled_at DESC, id DESC — same order
as list_runs) returning each task's most-recent run status. Powers the Tasks
list completion badge in one query instead of N per-row /runs fetches, and is
correct under overlapping run-now runs (unlike a denormalized last_run_status
column). Tasks with no runs are absent from the map.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* feat(scheduled tasks): run-now endpoint + status/next-run serializer fields
Backend for three Tasks-list run controls:
- last_run_status: _to_response now carries the task's most-recent run status
(from the windowed store query), populated on list/get/patch. Force-fail of
stale orphans runs BEFORE the status read so a dead run reports failed, not a
stuck running.
- next_run_at: _to_response carries the live scheduler's authoritative next-fire
ISO timestamp (scheduler.next_run_at) on list/get/create/patch — server-
sourced, never client-recomputed (paused/unarmed → null).
- POST /v1/scheduled-tasks/{id}/run: an immediate manual fire that REUSES the
shared fire path via build_run_now (same _run_fire_for_task body, dispatch/
preflight seams, and in-flight overlap guard as the scheduler). Paused tasks
are runnable (manual override); fire-and-forget → 202 Accepted. 409 when a
fire is already in flight, 404 for a non-owned task, 503 when the scheduler
subsystem is not running. Wired via app.state.scheduled_task_run_now.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* feat(scheduled tasks): status pill, run-now menu, next-run on rows
Wire the three run controls into the Tasks list UI:
- last_run_status → a completion pill on each row (Failed/Skipped/Running/
Queued). Succeeded and never-run render NO pill (success is not noise);
Failed is destructive, Skipped muted — matching the Paused pill styling.
- next_run_at → "Next: <time>" on the schedule subline, formatted in the
task timezone via a new formatNextRunAt() that only FORMATS the server's
ISO value (never client-recomputes; paused/unarmed → nothing).
- Run now → a "⋯ menu" item + useRunScheduledTaskNow mutation (POST
/{id}/run) that invalidates the list + that task's runs so the pill
updates. Runnable for paused tasks; row busy-disables while in flight.
scheduledTasksApi gains lastRunStatus + nextRunAt (interface + wire map)
and runScheduledTaskNow(). Unit tests: pill per status, no-pill cases,
next-run formatting (tz + calendar-day boundary), run-now mutation wiring.
e2e: new run-controls journey (Run now → recorded run + pill flips);
existing schedule-line assertions relaxed to to_contain_text now that the
server next-run renders on the same line.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* style(scheduled tasks): bump task title size/weight on rows
Make the scheduled-task row title slightly larger and bolder: text-sm →
text-base and font-semibold → font-bold. Subline, pills, and spacing are
unchanged. Updates the one TasksPage sort-order test that located the title
by its .font-semibold class to .font-bold.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* Revert "style(scheduled tasks): bump task title size/weight on rows"
This reverts commit e0195ce3c4977abdaeba5316426029f808edeef6.
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* style(scheduled tasks): title 15px, metadata 13px on rows
Trim the row title to exactly 15px and the metadata subline to exactly 13px
using arbitrary-px classes (text-[15px] / text-[13px]) — the app root scales
rem ~1.125×, so the standard text-sm/text-xs would render 15.75/13.5px and
can't hit the exact target. Weights unchanged: title font-semibold (600),
subline no weight class (inherits 400). Pills, spacing, next-run text, and the
⋯ menu are untouched.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* style(scheduled tasks): lighten metadata subline on rows
Soften the row metadata subline one notch to a lighter gray via an opacity
step on the same theme token: text-muted-foreground → text-muted-foreground/80.
Theme-aware (works in light + dark), size unchanged (13px), and the next-run
<span> keeps inheriting the same color (no own color class). Title, pills,
spacing, and the ⋯ menu are untouched.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* style(scheduled tasks): tighten row spacing 2px, remove run-status pill
- Row vertical padding py-3 → py-[11px]: trims each side 1px so the gap
between adjacent rows drops from 24px to 22px (the list is flex-col with no
gap, so the row padding is the whole inter-row spacing).
- Remove the last-run status pill (Failed/Skipped/Running/Queued) entirely per
design: drop the render block, the RUN_STATUS_PILL map, the statusPill local,
and the now-unused ScheduledTaskRunStatus import. The Paused pill is kept
as-is. The lastRunStatus API/store field is left in place (harmless data;
only the visual is removed). Subline, next-run text, and the ⋯ menu unchanged.
Drops the per-status pill test cases in ScheduledTaskRow.test.tsx (that UI is
gone); keeps the paused-pill, next-run, and run-now tests.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* style(scheduled tasks): relative "Next run in Xh" on rows
Switch the row next-run display from an absolute label ("Next: Today 9:00 AM")
to a compact relative delta ("Next run in 15h" / "in 6d" / "soon"):
- formatNextRunAt now returns a delta (nextRunAt − now): <60m → "in Xm" (min
"in 1m"), <24h → "in Xh", else "in Xd", all floored; a delta below 1 min
(imminent / clock skew) → "soon"; null/unparseable iso → null. The `timezone`
param is dropped (a pure delta needs no zone) — call site + useMemo deps
updated. This only formats HOW FAR AWAY the server's authoritative next_run_at
is; it never recomputes WHICH instant is next on the client, so the old
"no client-recomputed countdown" rule still holds.
- Row prefix "Next: " → "Next run " so it reads "Next run in 15h".
Tests: rewrote the formatNextRunAt unit tests for the relative buckets +
boundaries + "soon" + null; updated the row test to the "Next run in …" prefix;
reconciled the e2e (the old count==0 "Next run" guard flips to positively
asserting the server-derived relative label — its real intent, no client
recompute, is unchanged).
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
* style(scheduled tasks): darken row hover background
Bump the full-row hover tint one notch: hover:bg-muted/50 → hover:bg-muted/70
(same theme-aware `muted` token, higher opacity). The color-mix stays
`var(--muted) N% transparent`, so in light the effective tint goes ~2.9% → 4.1%
black and in dark the alpha goes 0.5 → 0.7 — visibly stronger but still subtle.
Comment updated to match. Nothing else changes.
Co-authored-by: Isaac
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
---------
Signed-off-by: Rahul Ravindranathan <rahulnathan73@gmail.com>
Adds a 'databricks_cli' credential_proxy type so sandboxed tools can use
the Databricks CLI without the real OAuth/PAT token ever entering the
sandbox. The operator lists which ~/.databrickscfg profiles to proxy;
each is materialized into the sandbox as a placeholder-only .databrickscfg
(oa_cred_* token), and the L7 egress proxy swaps the placeholder for the
real token on the way out.
- Refreshing token provider (DatabricksProfileTokenProvider) re-mints
short-lived OAuth tokens via the databricks SDK for long sessions;
CredentialRewriteRule gains an optional secret_provider and the proxy
resolves secrets per-swap (offloaded via run_in_executor).
- Placeholder-only files are materialized into the sandbox scratch dir
and pointed at via DATABRICKS_CONFIG_FILE / DATABRICKS_CONFIG_PROFILE.
- Requires the 'databricks' extra and linux_bwrap (the Go CLI ignores
SSL_CERT_FILE on macOS, so darwin_seatbelt is rejected at parse time).
- Egress stays operator-listed: the workspace host must be named in
egress_rules, consistent with the other credential_proxy types.
Signed-off-by: mxatone <mxatone@gmail.com>
## Related issue
N/A
## Summary
- Bring `omnigent-slack` into the lockstep release cycle (now four packages, not three): its `[project].version` was stuck at `0.1.0` while the rest of the repo moved to `0.7.0.dev0`, so the extra pin and lockfile drifted.
- Pin `omnigent-slack==0.7.0.dev0` in the root `slack` optional-dependency extra, mirroring the existing `omnigent-client==` / `omnigent-ui-sdk==` sibling pins so a published `omnigent[slack]` always pairs with the matching `omnigent-slack` release.
- Teach `scripts/update_versions.py` (the engine behind `.github/workflows/bump-version.yml`) about the 4th package: rewrite the slack `[project].version` and the extra `==` pin on every bump, and scan `[project.optional-dependencies]` (not just `[project.dependencies]`) when verifying sibling pins. Regenerate `uv.lock`.
## Test Plan
- `uv run --no-project --python 3.12 --with packaging python scripts/update_versions.py check` → prints `0.7.0.dev0` (all four packages agree, all sibling `==` pins present).
- `uv lock` → "Updated omnigent-slack v0.1.0 -> v0.7.0.dev0".
- `uv run ... python -m pytest tests/scripts/test_update_versions.py` → 13 passed (updated the test fixture + assertions for the 4th package).
- `tests/test_version.py::test_version_matches_pyproject` still passes (root pyproject == `omnigent/version.py` at `0.7.0.dev0`).
## Demo
N/A
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [x] Refactor / chore
- [ ] Docs
- [ ] Test / CI
- [ ] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [ ] Integration tests added / updated
- [ ] E2E tests added / updated
- [ ] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Updated `tests/scripts/test_update_versions.py` to include `integrations/slack/pyproject.toml` in the `repo_copy` fixture and adjusted the lockstep assertions (5 changed files, 4 `9.9.9` occurrences in root pyproject, 1 in slack). Verified the full suite (13 tests) passes. Also ran `update_versions.py check` and `uv lock` manually to confirm lockstep + lockfile consistency.
* feat(onboarding): report the installed-but-unconfigured harness state
Add the credential axis to the picker-facing readiness map so Claude, Codex,
and Pi report the yellow "installed but no credential" state — the signal the
web setup dialog needs to know when to offer an "Add credential" action
(the M2 keystone of Setup-From-the-UI). Purely additive: the values
("needs-auth" / "binary-missing") already exist in HarnessAvailability, and
the launch gate (harness_is_configured) stays binary-only, so a not-yet-authed
harness is never blocked from launching.
- New _family_provider_configured(): whether an omnigent-managed provider
(API key / gateway) serves the harness's family, reading the same config
omni setup's overview does. Subscription-kind is excluded (that lives in the
CLI's own login, judged by harness_cli_logged_in). Local, side-effect free,
never raises (fails to "no credential").
- Claude: ready when a provider is configured OR the CLI subscription login is
present (was CLI-login only — an API-key-only user wrongly showed yellow).
Checks config first to avoid the status subprocess on the common path.
- Pi: gains the axis it lacked entirely (was binary-only → always green once
installed). No CLI login, so binary + provider: installed-but-no-provider is
now "needs-auth".
Codex already had this (unchanged, the template). Qwen/OpenCode env-auth
unchanged.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* feat(onboarding): write a harness provider credential from the UI
Second PR of Setup-From-the-UI (M3, security-sensitive). Adds the path that
turns a yellow "installed but not configured" harness green from the browser
for Claude / Codex / Pi, host-agnostic (local or remote), reusing the
credential-write logic omni setup already uses.
Design: the server is an authz'd pass-through. It validates ownership + the
UI-auth allowlist and forwards the secret over the (TLS) tunnel; the host DAEMON
does the write on the runner. The server never persists the secret, and the
frame's secret_value field is redaction-named so it never lands on a telemetry
span. Gated behind OMNIGENT_HARNESS_INSTALL_ENABLED (default off) exactly like
the install route (404 when disabled).
- New non-interactive core omnigent/onboarding/harness_auth.py: store a key /
gateway (secret → keychain, else ~/.omnigent/secrets.json; a providers: entry
referencing keychain:<name>, never the raw key), adopt an existing host env
var by reference (env:<VAR>, value never read), and detect adoptable env
credentials (non-secret descriptors only). First provider on a family becomes
the default; unsupported families/kinds are refused.
- New host.store_secret / _result frame pair; host daemon handler resolves the
harness→family, calls the core, and re-reports readiness so the badge flips
without a reconnect. Pi maps to its preferred anthropic family.
- New route POST /v1/hosts/{id}/harnesses/{harness}/credential (owner-scoped,
allowlisted, flag-gated) + registry pending_secret_writes plumbing + tunnel
result resolution.
- Regenerated openapi.json.
Tests: core unit tests (incl. the no-raw-secret-in-config invariant), frame
round-trip + telemetry-redaction, host-handler unit tests, and a full route
integration test over a fake tunnel (ownership, flag-off, allowlist, failure
mapping). 243 pass across the affected suites.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* feat(onboarding): detect adoptable credentials on the host (adopt flow)
Adds the read side of the adopt flow: a host.detect_credentials frame pair +
GET /v1/hosts/{id}/credentials/detected that reports the credentials already
present on the host as NON-secret descriptors (family + source label + env var
name), so the UI can offer a one-click "adopt" instead of asking the user to
paste a key they already have. The value is never read or sent — adopt writes
an env:<VAR> reference via the existing store_secret path.
Owner-scoped + flag-gated like the credential-write route. Decode drops
malformed entries so a garbled payload can't inject a non-string field the UI
would trust. Adds frame round-trip (+ malformed-drop), host-handler, and route
integration (+ flag-off) tests; regenerated openapi.json.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(onboarding): tighten the credential route + adopt guard (Polly review)
Two review fixes on the credential-write path:
- The route gated on ui_installable_harnesses(), which includes the env-auth
opencode/qwen — the host handler then rejected them, turning a client/allowlist
problem into a confusing 502. Add ui_credential_configurable_harnesses() (the
Claude/Codex/Pi families the host can actually write) and gate on it, so
opencode/qwen get a clean 400 with no frame forwarded.
- adopt_env_credential now refuses an env var that isn't set on the host —
adopting an unset var would persist a provider entry that resolves to nothing
at the first turn. (Runs on the runner, so os.environ is the host's env.)
Tests: opencode/qwen added to the 400-rejection parametrize; an unset-env-var
adopt rejection case.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(server): serialize concurrent credential writes to one host (Polly review)
Polly non-blocking note: unlike the install route (which coalesces via
inflight_installs), the credential route had no guard against overlapping
writes. The daemon's write is a non-atomic load→merge→save of config.yaml
(twice — entry, then default), so two writes to one host in quick succession
(a double-click, or key + gateway) could interleave and clobber a sibling
providers: entry.
Add a per-connection credential_write_lock held around the store-secret
round-trip so writes to one host serialize. A gateway/local host still
processes different hosts concurrently (the lock is per HostConnection).
Adds an integration test that holds the first reply and asserts the second
frame only reaches the host after the first completes.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(onboarding): make Pi's auth step UI-authable and trackable
Pi's setup_steps auth descriptor was still the M1 shape (action="setup",
command="omnigent setup", status_key=None). Two consequences surfaced in
manual testing: (1) status_key=None made the step "unknown", so the setup
dialog dropped it and wrongly showed "Pi is ready" with no action even though
readiness reported needs-auth; (2) even rendered it was a CLI signpost, not
the credential form.
Pi is UI-authable now (PR A gave it the needs-auth readiness axis; the UI has
the credential form), so its auth step becomes action="auth" (opens the inline
form, keyed on kind=="auth"), command=None (Pi has no subscription CLI login),
status_key="authed" (trackable, so it's not dropped and the dialog reflects
the real state). Qwen stays the untracked env-auth signpost (not UI-authable).
Updates the pi test and adds a qwen-stays-signpost test.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* chore: use the `omni` CLI alias (omni setup) in setup guidance
Rename user-facing "omnigent setup" → "omni setup" in the harness setup-step
descriptors, the setup hint, and their doc-comments. `omni` is the installed
console entry point (pyproject: omni = omnigent.cli:main) and is already used
elsewhere in the codebase, so the shorter alias is correct and consistent.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* test: fix CI drift on the M3 backend branch (omni setup + auth action)
Two "Pytest (misc)" failures on this branch were stale test expectations, not
product bugs:
- tests/host/test_connect.py asserted the unconfigured-launch error names
"omnigent setup", but the earlier `omni` CLI-alias rename made the runtime
message say "omni setup". Update the positive assertion and the cursor
test's negative assertion (which guards that Cursor points at its own
installer, not the generic setup command) to the new spelling.
- tests/test_harness_capabilities.py restricted setup-step actions to
("install", "command", "setup"), but Pi's UI-authable step uses action
"auth" (added when Pi's credential step became a form). Add "auth" to the
allowed set; codex's own two-step assertion is unchanged.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* test: harden the install-flow e2e against a slow picker render
test_install_button_installs_missing_harness opened the agent picker and
immediately clicked the Codex row, but the picker mounts its rows only after
the /v1/agents fetch resolves. Under CI load that render lags, and a menu
opened before the data lands can render empty or re-close on the update — so
the bare open-then-click flaked with a 30s click timeout, the Codex row never
becoming actionable (seen across two different shards). Open the picker, wait
for the Codex row and re-open if the menu flapped, then click. No product
change; passes locally unchanged (the retry is a no-op on the fast path).
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* test: settle agent data before opening the picker in the install e2e
The install-flow e2e flaked (30s click timeout on the Codex row, then on the
picker trigger via an overlay pointer-interception when reopened). Root cause:
the picker opened before the /v1/agents fetch settled, racing the menu-open
against a re-render. Wait for the composer's "Set up Codex" notice (rendered
only once the Codex agent + its unconfigured host state load) BEFORE opening the
picker, then open once and click. Passes locally repeatedly.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* test: stop driving the agent picker in the install e2e (kill the flake)
The picker interaction was redundant — the single seeded Codex agent is already
auto-selected, so the composer's "Set up Codex" notice is present without
opening the dropdown. Driving the picker only added a menu-open-vs-async-render
race that flaked under CI load. Wait for the notice directly (generous 60s) and
click it to open the setup dialog.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* test: wait for network idle before asserting the setup notice (install e2e)
The "Set up Codex" notice depends on two async fetches re-rendering the
composer (/v1/agents auto-selecting the agent, /v1/hosts marking its harness
unconfigured). On loaded CI runners that chain lagged past the timeout and the
assertion raced the still-loading landing screen. Wait for network idle and the
host chip (readiness present) before asserting the notice.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* test: drop networkidle wait in install e2e (WS keeps network busy)
wait_for_load_state("networkidle") never fires in this app — the shell holds a
long-lived sessions/updates WebSocket, so the network is never idle. That wait
just burned its timeout and then raced the still-loading landing screen (the
"Set up Codex" notice was intermittently absent on CI). Replace it with plain
element waits (host chip, then the notice) at a generous 60s, matching every
other e2e_ui test. Passes locally repeatedly.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(host): adopt an env credential under its own family, not the harness's
Review (isaac, MAJOR): pi consumes both the anthropic and openai families, so
the UI can offer an OpenAI env var (e.g. $OPENAI_API_KEY) as adoptable for pi.
`_handle_store_secret` derived the family solely from the harness (pi→anthropic)
and passed that to `adopt_env_credential`, so adopting that var wrote an
anthropic-family provider whose api_key_ref is env:OPENAI_API_KEY — mis-routed
to the anthropic endpoint, failing at run time. For the adopt kind, look the env
var up in the host's detected credentials and use its OWN detected family
(falling back to the harness family if absent). Adds a pi-adopts-OpenAI
regression test.
Also carry the install-flow e2e fix onto this branch: explicitly select Codex
in the picker and stub the /v1/sessions?kind=any agent scan so the seeded-DB
agents don't leak in and leave Claude Code selected (a CI-only flake).
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* fix(host): harden the UI credential-write path (review feedback)
Addresses Polly's blocking finding + hardening notes and Pat's nits on the
store_secret/adopt path:
- BLOCKING (adopt boundary): the daemon's adopt handler fell back to the
harness-derived family when an env var wasn't detected, and adopt_env_credential
only checked the var was *set*. An owner hitting the raw API could name any set
env var (a DB password, an unrelated secret) and have it persisted as a provider
credential sent to the vendor endpoint. Now the handler refuses an env_var that
isn't in detect_adoptable_credentials() (no fallback) — enforcing server-side the
same "only adopt what was detected" restriction the UI presents.
- secrets.py: create the file-backend secrets.json 0600 atomically via
os.open(O_CREAT, 0o600) instead of open()+chmod-after, which briefly left a
freshly-created file group/world-readable. Now network-triggerable, so worth
closing. Fixes the stale "0600 from the start" comment.
- adopt_env_credential: presence-only env check (`in os.environ`, not `.get`) so
the "never reads the value" contract stays literally true.
- gateway base_url: reject a non-http(s) scheme at write time rather than writing
a malformed provider entry that fails opaquely at the first turn.
- connect.py: hoist the harness_auth / provider_config imports to module top
(no circular import) to match the sibling onboarding imports.
Adds regression tests: adopt refuses an undetected env var, gateway rejects a
non-http base_url, and secrets.json is 0600 even under a permissive umask.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
---------
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
The Docker entrypoint's build_app() was constructing RuntimeCaps()
bare, so the llm:, policies:, and routing: blocks in a docker
deployment's config.yaml were silently ignored. This meant:
- Builtin policies that read event["llm_client"] (e.g.
deny_trivial_to_expensive_model) would always see None and abstain.
- default_policies declared under policies: would never fire.
- LLM-based and external routing clients were never built.
Mirror the logic from cli.py: parse_server_llm / parse_default_policies
/ routing client construction are now applied before RuntimeCaps is
passed to init_runtime, putting docker deployments on par with the
CLI-started server.
Fixes#3159
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Follow-up to #3189. Every session serialization path collapses per-user
`omnigent.pinned.<user>` keys via `_labels_for_viewer` except
`_child_session_summary_from_conversation`, which passed `conv.labels` through
raw. Child sessions aren't pinnable today (the pin affordance lives only on
top-level sidebar rows), so this is a latent gap rather than a live leak — but
if a shared child were ever pinned, its summary would expose another viewer's
pin key.
- Strip any `omnigent.pinned.<user>` key from a child summary's labels. No
collapse-to-canonical: there's no pin to surface, just the defensive strip.
- Test: a child carrying two users' pin keys yields a summary with no pin key,
while unrelated labels survive.
- Correct the stale `useMigrateLocalPinsToServer` docstring: the migration
patches the pinned-list cache (like `useTogglePinnedConversation`), it does
not invalidate the pinned query.
Co-authored-by: Isaac
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
* fix(pi-executor): add supportsUsageInStreaming:false to databricks-completions
Gemini, Qwen, inkling, and other non-OpenAI models in the databricks-completions
provider reject stream_options (which Pi sends with include_usage:true by default)
with 400 'unknown field'. Add supportsUsageInStreaming:false to suppress it,
matching what pi_native_credentials.py already does for omnigent-completions.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi-executor): use openai-responses for newer GPT models (gpt-5-5, gpt-5-6-*)
Newer GPT models reject function tool calls via /chat/completions with 400.
The Databricks Responses API (/ai-gateway/codex/v1/responses) now supports
tool-result chaining on subsequent turns (previously it did not).
- Add databricks-openai provider using openai-responses at /ai-gateway/codex/v1
for gpt-5-5, gpt-5-6-*, gpt-5-3-codex (matches pi_native_credentials routing)
- Keep databricks provider (openai-completions at /serving-endpoints) for
older GPT models (gpt-5-4, gpt-5-4-mini) that work fine with /chat/completions
- Add _pi_needs_responses_api() helper mirroring pi_native_credentials
- Update _pi_provider_for_model() to route to databricks-openai when needed
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi-executor): add kimi to reasoning model fragments
kimi-k2-7-code streams output on reasoning_content channel like GLM/DeepSeek.
Without reasoning:true in the model entry Pi ignores reasoning_content and
sees an empty stream, throwing 'Stream ended without finish_reason'.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(test): update kimi model entry to expect reasoning:true flag
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi-native): add reasoning:true to kimi/glm/deepseek model entries
These models stream output on reasoning_content channel. Pi's openai-completions
parser requires reasoning:true on the model entry to consume that channel;
without it the stream has no content and the turn ends with
'Stream ended without finish_reason'.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(pi-native): exclude qwen3 from completions provider
qwen3 models return content as a typed array [{type:'reasoning',...},{type:'text',...}]
when tools are present, causing Pi's streaming handler to produce [object Object].
Same root cause as gpt-oss; same fix.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix: add inkling to reasoning model fragments and LLM detection
Both kimi and inkling stream output on reasoning_content channel with
content=null. Added inkling to _PI_REASONING_MODEL_FRAGMENTS (executor),
reasoning:true model entry condition (pi-native), and LLM name detection
tokens so it appears in the model list.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* refactor: use allowlist for GPT completions-compatible models
Instead of a denylist of specific model ids that need the Responses API,
maintain an allowlist of GPT models known to work with /chat/completions.
Any GPT model not in the allowlist defaults to Responses API — safer
for new models not yet explicitly tested.
The executor's _pi_needs_responses_api now delegates to the same
implementation in pi_native_credentials for a single source of truth.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Smart routing was gated behind an OMNIGENT_SMART_ROUTING=1 opt-in on top of the
routing/llm config. The env is redundant: build the routing client whenever the
config supplies one — a server llm: block (built-in judge) or a
routing.provider=external block (external routes:select service). Remove the env
gate in cli.py and refresh the stale references in app.py, advise_models.py, and
web capabilities.ts. Server smart_routing_enabled already keyed on the resolved
client, so the /v1/info signal is unchanged.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
The modular-registry proposal described the phases as thin numbered lists.
Turn them into a concrete, verified implementation plan reviewers can cost:
- Add a "Current state (verified 2026-07-24)" subsection grounding the plan
in the tree at main (59e6b70e): data model ready but no native_providers
field; run_<x>_native already near-uniform (only claude/codex/antigravity/
opencode carry extra kwargs); coverage uneven across hubs (resume 10,
chat-redirect 6, interrupt 9, stop 7); dead _HARNESS_MODULES literal still
present; harness_catalog() emits no native-agent rows.
- Phase 1 (core-only seam): 8 PRs (1.1–1.8) in a table with scope, key files,
dependencies, risk, and estimates. 1.1 provider model + resolver is the
additive foundation; 1.5 runner launch/terminal-route is the risk center.
- Phase 2 (community + web): 4 PRs (2.1–2.4).
- Add an effort summary: ~26–37 engineer-days across ~12 PRs, critical path
1.1 → 1.2 → 1.5 → 2.2 → 2.3. Refresh the Bottom line to match.
Docs-only; no code paths affected.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
* fix(web): remove "Create new project" from the project picker menu
Projects are created via the + icon next to the Projects header in the
sidebar, so the picker's own "Create new project" row was a redundant,
second entry point. Drop it (and the inline new-project input it toggled)
from ProjectPickerMenu, leaving search, the project list, and "Remove
from <project>".
Co-authored-by: Isaac
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
* test(e2e_ui): file sessions via the + button after dropping picker create
The project picker no longer offers an inline "Create new project" row, so
the e2e helpers that drove that flow broke. Rewrite `_move_to_new_project`
to create the empty project from the Projects-header + button first, then
file the session via the kebab picker by name.
Co-authored-by: Isaac
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
---------
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
* feat(sessions): persist pinned sessions server-side as a per-user label
Pins were client-only (localStorage), so they didn't follow a user across
devices. Move them to a server-side per-user session label so a pin persists
and stays per-user even on shared sessions.
- Store: `omnigent.pinned.<user_id>` label (value = epoch-ms pin time);
`pinned_label_key()` hashes over-long user ids to fit the 128-char key
column. `list_conversations(pinned=True, pinned_owner=…)` filters to the
caller's own key.
- Route: `GET /v1/sessions?pinned=true` enumerates the caller's pins
(independent of the loaded window); PATCH rewrites the client's canonical
`omnigent.pinned` to the caller's per-user key, and `_labels_for_viewer`
collapses it back on read so the per-user dimension never crosses the API
and no viewer sees another user's pin key.
- Write-integrity: reject any client-supplied suffixed `omnigent.pinned.<user>`
key so a caller can't pin/unpin for someone else.
- Forks drop per-user pin keys by prefix (a clone must not inherit pins).
- Web: server-authoritative `usePinnedConversations` + optimistic
`useTogglePinnedConversation`; Pinned section ordered by pin timestamp;
one-time localStorage->server migration that retains pins whose write failed.
- Guard `relativeTime`/`absoluteTime` against non-finite input (no more "NaNy").
Co-authored-by: Isaac
* test(e2e-ui): drive visual-snapshot pins via ?pinned=true, not localStorage
The populated-sidebar visual baseline seeded the pinned session in localStorage,
but pins are now server-authoritative (GET /v1/sessions?pinned=true). Under the
new model the localStorage seed is ignored and the bare-list stub answered the
pinned query too, so every row rendered as pinned → baseline mismatch (the
non-blocking UI Snapshot job).
- Split a `?pinned=true` route out from the bare-list regex (which now also
excludes `pinned=`, mirroring the existing `project=` exclusion) and return
just the pinned row, carrying the canonical `omnigent.pinned` label.
- Drop the `omnigent:pinned-conversation-ids` localStorage seed.
- Apply the same fix to the pinned-project flyout baseline (it passed only by
luck — its bare-list stub happened to return exactly the one pinned row) and
give its row the pin label so it's explicit, not incidental.
Co-authored-by: Isaac
* fix(sessions): let read-only collaborators pin a shared session
Pinning moved server-side (per-user `omnigent.pinned.<user>` label) but the
session PATCH gated all label writes at LEVEL_EDIT, so a read-only collaborator
on a shared session could no longer pin it — a regression from the localStorage
model, which had no permission check.
- Gate a pin-only PATCH (labels == {omnigent.pinned}, no other field) at
LEVEL_READ: pinning is a personal per-viewer preference, not an edit to the
session, so anyone who can SEE it may pin it. Any other field keeps the
edit/owner requirement. Unpin ("" value) is still pin-only, so it downgrades
too. The `?pinned=true` list is already scoped `accessible_by`, so a shared
pin surfaces on "Shared with me".
- Tests: a LEVEL_READ grantee can pin AND unpin a shared session; the downgrade
stays narrow (a non-pin label, or a pin bundled with one, still 403s).
- Rework the access-tier comment to match the if/elif/else (READ / OWNER / EDIT).
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
Co-authored-by: Isaac
---------
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
PRs #3148 (extract native terminal orchestration) and #3149 (split the
native app-session test monolith) landed the two remaining Phase 0 file
splits. Update the proposal to reflect reality:
- §1 runner hub: app.py is now ~10.1k lines (was ~20.1k) plus the new
omnigent/runner/native/orchestration.py (~6.5k); drop the stale absolute
line-number anchors and clarify that the dispatch arms and interrupt/stop
closures stayed in app.py while the builders/mirrors moved out.
- Phase 0: mark both runner/app.py and the test monolith Done, noting the
single-orchestration.py outcome (vs the proposed three-way split) and the
nine concern-scoped test modules + shared conftest.py.
- Risk section: re-anchor the forwarder registry to _AUTO_FORWARDER_TASKS in
its new home and note the risk now shifts to Phase 1.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
* refactor(server): split sessions.py into domain sub-modules
sessions.py (7799 lines) is split into 8 focused route files under
_sessions/:
routes_core.py — CRUD, list, WS updates, fork, switch-agent
routes_hooks.py — /hooks/* and /policies/evaluate
routes_items.py — /items and /child_sessions
routes_resources.py — /resources/* (terminals, files, environments)
routes_browser.py — /browser/*
routes_elicitations.py — /elicitations/*
routes_events.py — /events, /stream, DELETE /sessions/{id}
routes_permissions.py — /permissions/*, /owner
routes_agent.py — /agent, /agent/contents, /mcp
Each file exports a register_X_routes(router, ...) function.
create_sessions_router() becomes a thin delegator (~533 lines).
helpers.py gains proxy wrappers for _same_provider_family,
_agent_is_native, _agent_carries_native_fork_history,
_presentation_labels_for_agent, and _reset_runner_resources_after_switch
so existing test monkeypatches on sessions.<name> continue to work.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* refactor(server): move sessions/ route sub-modules out of _sessions/
Convert sessions.py to a sessions/ package and move the 8 routes_*.py
files from _sessions/ into sessions/, so the public package layout is:
routes/sessions/__init__.py (facade, formerly sessions.py)
routes/sessions/routes_core.py
routes/sessions/routes_hooks.py
routes/sessions/routes_items.py
routes/sessions/routes_resources.py
routes/sessions/routes_browser.py
routes/sessions/routes_elicitations.py
routes/sessions/routes_events.py
routes/sessions/routes_permissions.py
routes/sessions/routes_agent.py
_sessions/ retains only the private internals (common, helpers,
orchestration) that do not need public names.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(server): use facade indirection for session_stream and get_agent_cache consistently
routes_browser, routes_events, and routes_hooks were still calling
session_stream.publish() and get_agent_cache() via the direct module
binding. Apply the same facade-indirection pattern already used in
routes_core so all call sites are consistent and test monkeypatches on
sessions.session_stream / sessions.get_agent_cache are honored.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(server): fix lint, _to_agent_object closure, and pyproject.toml exemptions
- Move _policy_type, _policy_description, _to_agent_object from inside
register_permissions_routes closure to module-level in routes_permissions.py
so routes_agent.py can import them directly. Fixes NameError crash on
GET /sessions/{id}/agent in server-approvals tests and E2E tests.
- Add missing 'return router' at end of register_permissions_routes (was
missing after the closure reorganization).
- Import the three helpers explicitly in routes_agent.py.
- Update pyproject.toml per-file-ignores to cover sessions/*.py and
sessions/__init__.py with the same exemptions the original sessions.py
had (ARG001, ARG002, BLE001, E501, F401, F403, F405) so pre-commit
ruff passes.
- Run ruff format on all sessions/ sub-modules.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(server): fix all proxy/monkeypatch misses and restore noqa directives
Route sub-modules were importing _X_impl directly instead of using the
facade proxy, causing monkeypatch(sessions, '_X', ...) to have no effect.
Fix by removing all '_X_impl as _X' imports from routes_*.py — the star-
imports from _sessions.helpers and _sessions.orchestration already bring
in the correct facade-delegating proxies.
Additional fixes:
- Access _SESSION_UPDATES_MAX_WATCHED, _SESSION_UPDATES_RESCAN_INTERVAL_S,
_SESSION_UPDATES_HEARTBEAT_INTERVAL_S through the facade in routes_core.py
so monkeypatch(sessions_routes, '_SESSION_UPDATES_*', N) works.
- Use _load_agent_spec_for_session proxy (not impl) in routes_resources.py.
- Access get_caps() through facade in routes_hooks.py evaluate_policy so
monkeypatch('omnigent.server.routes.sessions.get_caps', ...) fires.
- Restore noqa: BLE001 and F401 directives in _sessions/helpers.py and
_sessions/orchestration.py that were stripped by the RUF100 auto-fix.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(server): delete old sessions.py, fix remaining facade proxy misses
- Delete omnigent/server/routes/sessions.py (the file was rm'd in a prior
commit but never staged; CI was still linting it and seeing F403/F405).
- Route _HOST_BOUND_RUNNER_CONNECT_GRACE_S through the facade in
routes_events.py (3 call sites) so monkeypatch(sessions_module,
'_HOST_BOUND_RUNNER_CONNECT_GRACE_S', ...) is honored.
- Route _recover_subagent_status_forward_via_parent through facade
in routes_events.py.
- Route _registered_runner_id through facade in routes_core.py.
- Route _BROWSER_ACTION_AWAIT_S through facade in routes_browser.py.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(server): route patchable names in routes_hooks.py through facade
All five hook handlers and evaluate_policy use module-level timeout
constants (_CLAUDE_NATIVE_PERMISSION_HOOK_TIMEOUT_S etc.) and auth
helpers (_get_user_id, get_caps, get_agent_cache) that tests monkeypatch
on the sessions facade module. Access them through _sf (the facade) at
call time so monkeypatch(sessions_route, '_CLAUDE_NATIVE_PERMISSION_HOOK_TIMEOUT_S', 0.1)
and monkeypatch('omnigent.server.routes.sessions.get_caps', ...) are honored.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
---------
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Re-running CI today means pushing an empty commit or rebasing, which fires a
push event and dismisses existing approvals (branch protection keeps
dismiss-stale-reviews on to block approve-then-swap). A `/rerun` comment
re-runs failed jobs on the existing head SHA instead -- no new commit, so
approvals survive.
Authorized to the PR author or a write-access commenter. Only re-runs the
mock-LLM `pull_request` test suites; the merge gates and Polly AI Review are
left alone. Single file (no privileged relay) because issue_comment gets a
writable base-repo token even for fork PRs.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
--edit-last edits the most recent PR comment regardless of author or
content, so it was overwriting the UI preview comment when both workflows
ran on the same PR. Switch to the same find-by-marker + PATCH approach
used by ui-preview.yml so each workflow manages its own comment.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* fix(web): make session rename optimistic so the new name shows instantly
Renaming a session left the stale name in the sidebar for the duration
of the PATCH round-trip: all cache patching happened in the mutation's
onSuccess, so the row only repainted once the server responded.
Move the cache overlay into onMutate so the new title paints on the next
frame, snapshot the old title for rollback, and restore it in onError.
onSuccess still reconciles with the server-confirmed title + updated_at
and keeps the deliberate no-refetch behavior (an immediate GET races the
search-index reindex). Also patch the ["project-sessions", name] caches
that project folders render from — the flat ["conversations"] overlay
never touched them, so a filed session's row stayed stale until the WS
reconcile.
Co-authored-by: Isaac
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
* fix(web): cancel in-flight list queries before optimistic rename overlay
Close the in-flight-reconcile clobber race flagged in review: an
already-running GET /v1/sessions reconcile poll (or a WS-triggered
fetch) could resolve after onMutate and overwrite the optimistic title
with the stale search-indexed name. Cancel the ["conversations"] and
["project-sessions"] queries in onMutate before overlaying so no
in-flight fetch can win.
Co-authored-by: Isaac
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
---------
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
Add an opt-in agent_name field to SessionCreatedEvent. Only polly and
debby are populated — all other agent names are withheld to avoid leaking
user-defined agent names in telemetry.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
* feat(sandbox): support OMNIGENT_CONTAINER_RUNTIME env var for container runtime selection
Allow switching the container runtime (e.g. from docker to podman) via the
OMNIGENT_CONTAINER_RUNTIME environment variable instead of requiring per-agent
YAML configuration. The per-agent container_runtime key still takes precedence
over the env var.
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
* fix(test): add missing top-level `Any` import in test_local.py
Ruff flagged F821 (undefined name) because `Any` was used in a
runtime dict annotation but only imported inside a nested function.
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
* fix(test): read version dynamically in crash handler test
The test hardcoded "0.6.0.dev0" which breaks when the installed
version diverges from the source (e.g. after a version bump).
Read omnigent.version.VERSION at runtime instead.
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
* Revert "fix(test): read version dynamically in crash handler test"
This reverts commit 53855f5c10e3573e9d1ddbfd2afb0bd76abbc91e.
* fix: address review comments on container runtime PR
- Make container_runtime field explicitly Optional to avoid misleading
type annotation and unnecessary type-ignore
- Update parser docstring to mention OMNIGENT_CONTAINER_RUNTIME as an
additional default source
- Update shell script header comment to say "container runtime" instead
of "Docker"
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
* fix(test): add autouse fixture to clear OMNIGENT_CONTAINER_RUNTIME
Prevents the host environment from leaking into tests that assume
the default runtime is "docker".
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
* style: add missing blank line before autouse fixture
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
* fix: address additional review comments on container runtime PR
- Rename _ALLOWED_RUNTIMES to ALLOWED_RUNTIMES (public API used
cross-module by the parser)
- Reject container_runtime: null in YAML instead of silently falling
back to the env var default
- Add test for container_runtime: null rejection
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
---------
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
* feat(onboarding): report the installed-but-unconfigured harness state
Add the credential axis to the picker-facing readiness map so Claude, Codex,
and Pi report the yellow "installed but no credential" state — the signal the
web setup dialog needs to know when to offer an "Add credential" action
(the M2 keystone of Setup-From-the-UI). Purely additive: the values
("needs-auth" / "binary-missing") already exist in HarnessAvailability, and
the launch gate (harness_is_configured) stays binary-only, so a not-yet-authed
harness is never blocked from launching.
- New _family_provider_configured(): whether an omnigent-managed provider
(API key / gateway) serves the harness's family, reading the same config
omni setup's overview does. Subscription-kind is excluded (that lives in the
CLI's own login, judged by harness_cli_logged_in). Local, side-effect free,
never raises (fails to "no credential").
- Claude: ready when a provider is configured OR the CLI subscription login is
present (was CLI-login only — an API-key-only user wrongly showed yellow).
Checks config first to avoid the status subprocess on the common path.
- Pi: gains the axis it lacked entirely (was binary-only → always green once
installed). No CLI login, so binary + provider: installed-but-no-provider is
now "needs-auth".
Codex already had this (unchanged, the template). Qwen/OpenCode env-auth
unchanged.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* docs(onboarding): clarify _family_provider_configured checks entry presence
Polly review nit: the helper returns True when a non-subscription default
provider *entry* exists, not when its secret actually resolves — an entry
pointing at an unset env:/keychain ref still reads configured (matching the
secret-blind omnigent setup overview). Reword the docstring from "usable
credential" to "a default provider entry is present" and note the
secret-blind behavior + why it's safe (launch gate is binary-only; signal
only moves toward green). No behavior change.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* refactor(onboarding): address review nits on readiness detection
- Hoist the provider_config import in `_family_provider_configured` to the
module top (no circular import); update the test monkeypatch targets to the
now-module-bound name.
- Drop the internal milestone label from a test docstring.
Co-authored-by: Isaac
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
---------
Signed-off-by: xq-yin <xiaoqian.yin@databricks.com>
* feat(sandbox): parse and validate sandbox.kubernetes.pvc_mounts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* feat(sandbox): add pvc_mounts volumes to the runner Pod manifest
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* feat(sandbox): thread pvc_mounts through the kubernetes launcher
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* docs(deploy): document sandbox.kubernetes.pvc_mounts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* feat(sandbox): fail loud on unknown sandbox.kubernetes keys
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* test(sandbox): lock in pvc_mounts collision-order, null read_only, and claim-reuse semantics
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* test(sandbox): pin the reserved-mount HOME prefix to the launcher's _HOME_DIR
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* refactor(sandbox): reuse shared validators in the pvc_mounts parser
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(sandbox): close pvc_mounts reserved-path gaps from review
Reject mount_paths with exactly two leading slashes — POSIX normpath
preserves them so '//home/omnigent' passed both validation gates while
the kernel collapses '//' to '/' at mount time, shadowing HOME. Add
/opt to the reserved prefixes: the host image's omnigent venv lives at
/opt/venv and was shadowable. Both cases now covered in the fail-loud
parametrization.
Co-authored-by: Isaac
Signed-off-by: Bryan Li <bryan.li@gmail.com>
* fix(sandbox): reject pvc_mounts paths that mount over reserved prefixes
The reserved-path check only caught mount_paths at or under a reserved
prefix, so an ancestor like /home or /var passed validation while
mounting over the HOME emptyDir mountpoint or the Secret projections.
Reject ancestors too, and reserve /run, /var/run, and /var/lock in full
so the Debian image's /var/run -> /run and /var/lock -> /run/lock
symlinks can't alias around the lexical check.
Co-authored-by: Isaac
Signed-off-by: Bryan Li <bryan.li@gmail.com>
---------
Signed-off-by: Bryan Li <bryan.li@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
## Related issue
Closes F-CR-6
## Summary
- `DeepLink.parse` validated the `/c/<id>` segment with only `!contains("/")`, but Foundation's `URL.path` is percent-DECODED — so `omnigent://host/c/id%3Fview=terminal` exposes `?` as a literal in the path and smuggles a query (and `%23` a fragment, `%2e%2e` a `..`, `%00` a control char) past the intended "/c/<id> only" shape. Added a denylist that rejects `?`, `#`, `/`, `.`, `%`, and control chars in the decoded id, so an encoded separator that `URL.path` decoded into one of those is dropped.
- The denylist deliberately does NOT assume the id's exact format (the server emits 32-hex uuids today, but the SPA's `/c/:id` route accepts any non-slash segment); the SPA stays the authority on id validity, and a future id scheme (ULID, nanoid, base64) won't be silently rejected. Benign non-canonical ids like `conv_abc` are accepted; only structure-smuggling is blocked.
- Documented the custom-scheme hijack risk in `DeepLink.swift`: iOS doesn't verify single ownership of `omnigent://`, so a co-installed app can read the link's host + id (metadata disclosure). For managed Databricks domains that can serve an `apple-app-site-association`, prefer verified Universal Links; the custom scheme is retained for BYO/OSS servers that can't host AASA, with the interception risk documented.
## Test Plan
- Unit tests (`OmnigentTests/DeepLinkTests`): 19 cases, all pass — including `testRejectsSmuggledQueryViaEncodedQuestionMark` (`%3F`→`?`), `testRejectsSmuggledFragmentViaEncodedHash` (`%23`→`#`), `testRejectsEncodedDotAndDotDot` (`%2e%2e`), `testRejectsControlCharacters` (`%00`/`%0A`/`%7F`), `testRejectsMalformedPercentEscape` (`%zz`), and `testAcceptsBenignNonCanonicalIds` (`conv_abc`/`x`/`not-a-uuid` are accepted — no smuggled structure).
- UI tests (`OmnigentUITests`): 6 cases via a DEBUG-only `--omnigent-open-url` launch-argument seam that routes the link through the real `handleDeepLink`/`DeepLink.parse` (XCUITest can't reliably deliver custom-scheme URLs on this toolchain). `testValidDeepLinkShowsConsent` (valid link → consent alert), `testBenignNonCanonicalIdIsAccepted` (`conv_abc` → consent alert), and rejection tests for smuggled `?`/`#`/`..`/control-char (no alert). A `--omnigent-reset-state` flag wipes persisted server state so each case starts with no known server. All pass on the iOS simulator.
- Manual simulator verification: drove `xcrun simctl openurl` against the running app with `OMNIGENT_DEEPLINK_TRACE` set; NSLog trace confirmed `ACCEPTED` for the valid link and `REJECTED` for all 5 smuggling/malformed links (smuggled `?`/`#`, `..`, control char, non-id).
## Demo
N/A
## Type of change
- [x] Bug fix
- [ ] Feature
- [ ] UI / frontend change
- [ ] Refactor / chore
- [ ] Docs
- [x] Test / CI
- [ ] Breaking change
## Test coverage
- [x] Unit tests added / updated
- [x] E2E tests added / updated
- [x] Manual verification completed
- [ ] Existing tests cover this change
- [ ] Not applicable
## Coverage notes
Manually verified end-to-end on the iOS simulator: launched the app with `OMNIGENT_DEEPLINK_TRACE=1` and sent six real `omnigent://` links via `xcrun simctl openurl`. The NSLog trace showed `ACCEPTED` for the valid link and `REJECTED` for all smuggling/malformed links, proving the fix through the real `DeepLink.parse` → `handleDeepLink` path. The DEBUG-only `--omnigent-open-url` / `--omnigent-reset-state` launch-argument seam and `OMNIGENT_DEEPLINK_TRACE` NSLog logging are compiled out of Release builds (gated by `#if DEBUG`), so there is no production behavior change from the test infrastructure.
* fix(cli): normalize Azure Databricks custom-URL workspaces to their canonical host
omni login (and omni host) failed for Azure Databricks workspaces with a custom
(vanity) URL like https://mydomain.azuredatabricks.net/?o=<workspace_id>: the
vanity edge 303-redirects the unauthenticated probe to /login instead of
answering, so _databricks_workspace_login_target does not recognize the
Databricks posture and login fails. The canonical host
adb-{workspace_id}.{workspace_id % 20}.azuredatabricks.net does answer, and the
?o=<workspace_id> selector already carries the id.
Rewrite the custom host to the canonical adb- form in _resolve_server_url (the
shared normalization every --server entry point uses, so omni host is covered
too). Only *.azuredatabricks.net hosts that are not already the adb- form and
carry a numeric ?o= are touched; AWS/GCP hosts, canonical URLs, and URLs without
a selector are left unchanged.
Closes#2781
Signed-off-by: Enes Yilmaz <enesyilmaz5157@gmail.com>
* fix(cli): probe before adopting the canonical Azure Databricks host
The custom-URL fix landed the canonical adb- host rewrite unconditionally in
_resolve_server_url, so a wrong synthesis could strand the user on a host they
never typed, and the unit tests only re-asserted the implementation's own
arithmetic (123 % 20 == 3), which would pass under any modulus.
Try the URL as the user gave it first. Only when that fails to resolve, and only
for an Azure vanity workspace URL carrying a numeric ?o=, synthesize the
canonical host, probe it, and adopt it if it answers. A dead synthesis now falls
back to the user's URL instead of replacing it.
The shard rule remains an observed regularity rather than a documented contract
(Microsoft calls the segment a random number and treats properties.workspaceUrl
from the ARM API as authoritative), so the probe keeps it off the load-bearing
path. Docstrings say so plainly.
Also:
- _canonicalize_azure_databricks_url is now _canonical_azure_databricks_url and
returns None to decline, so a caller can tell "not applicable" from "no change".
- Guard the selector with isascii() as well as isdecimal(): str.isdecimal()
accepts non-ASCII digits that int() also parses, which synthesized a
nonsensical host.
- _probe_root reduces a URL the way _workspace_api_server_url does before
probing. Without it the comparison against the expansion's result never
matched (it drops the ?o= selector first, and that selector is what makes a
URL a candidate), and the new probe requested /?o=123/v1/me.
- Replace the tautological shard assertions with five real observed
workspace/host pairs, and drive the resolver tests through the real expansion
with only httpx scripted, since a stubbed expander cannot catch the above.
Signed-off-by: Enes Yilmaz <enesyilmaz5157@gmail.com>
* docs(cli): drop issue-number refs from Azure canonical-host comments
The repo's comment convention says code comments should describe the
scenario, not reference issue/PR numbers. Remove the (#2781) tags from
the _canonical_azure_databricks_url / _resolve_server_url docstrings and
the vanity-URL fallback test; the surrounding prose already explains the
Azure vanity-host case without needing the external link.
Co-authored-by: Isaac
Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
---------
Signed-off-by: Enes Yilmaz <enesyilmaz5157@gmail.com>
Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
Co-authored-by: Pat Sukprasert <pat.sukprasert@databricks.com>
* fix(runner): resolve and re-materialize file attachments on remote-runner history reload
Signed-off-by: Sunny Yang <sunnyadn1130@gmail.com>
* fix(runner): seed the native-session compaction anchor; tolerate malformed file metadata
Native-harness sessions skip the history reload entirely, which also
skipped seeding the last server item ID that harness compaction
persistence anchors on — compactions then silently stopped persisting.
Session create now fetches just the newest item ID (newest-first, single
item, no attachment downloads) for native harnesses.
A 200 metadata response with an unparseable body no longer aborts
attachment resolution: both resolvers (the runner's message-content
resolver and the claude-native transcript rebuild) fall back to the
content response's Content-Type for the media-type hint.
Signed-off-by: Sunny Yang <sunnyadn1130@gmail.com>
* refactor(attachments): centralize file_id resolution and reference-line emission in native_attachments
The transcript rebuild and the runner each carried a full copy of the
file_id fetch-and-inline pipeline, and nine native executors repeated
the same materialize-or-marker block. Both now live in
native_attachments: resolve_file_id_block() serves the runner and the
transcript rebuild, attachment_reference_line() serves the executors,
and ATTACHMENT_MARKER_STRIP_PATTERN replaces four hand-copied forwarder
regexes. Materialized filenames are sanitized the same way as marker
names so a bracketed filename cannot break the marker consumers, and
the resume dedupe short-circuits on file size before reading bytes.
Signed-off-by: Sunny Yang <sunnyadn1130@gmail.com>
* fix(attachments): replay resolved history attachments as structured content
Cold-started claude-sdk sessions flattened prior turns into a text
prefix, so a resolved historical image reached the model as the marker
[image: name, media_type, N base64 chars]. The bytes never arrived, which
leaves the #882 symptom in place for that harness: the model describes an
attachment it cannot see.
Prior-turn attachments now replay as real Anthropic image/document blocks
via the existing converter, interleaved in transcript order. Text-only
history still takes the plain-string path and renders byte-identically,
unresolved attachments keep their existing marker, and base64 still never
enters prompt text.
Materialization also derives its collision suffix from a content hash
rather than a random one, so a history carrying two distinct uploads of
the same filename keeps one file per payload instead of gaining a copy on
every transcript rebuild.
The two tests that asserted the compact-placeholder shape are replaced by
cold-reload tests: that shape is the behavior being corrected, but the
invariant those tests protected (no base64 in prompt text) is asserted
against the prompt's text blocks.
Signed-off-by: Sunny Yang <sunnyadn1130@gmail.com>
* refactor(attachments): collapse duplicated prompt-shape branches
The structured and plain-text arms of _build_prompt returned the same
value whenever the latest message was multimodal, and re-scanned the
block list to decide which arm to take. Coalescing already leaves an
all-text history as one block, so the block count answers that.
Materialization's second identity check was a no-op guarding a write
that produces the same bytes, so the collision path flattens to one
branch.
Signed-off-by: Sunny Yang <sunnyadn1130@gmail.com>
* refactor(tests): keep runner conftest identical to upstream
Move the file-server fake's items/failure/malformed-meta behaviors out of
the shared _FakeFileServerClient into local subclasses in the one file
that uses them, so conftest.py stays in sync with upstream and per-test
modes stay next to their tests.
Signed-off-by: Sunny Yang <sunnyadn1130@gmail.com>
---------
Signed-off-by: Sunny Yang <sunnyadn1130@gmail.com>
Co-authored-by: Pat Sukprasert <pattara.sk127@gmail.com>
The before-quit handler defers the quit until serverManager.shutdown()
finishes, then re-issues app.quit() as the *only* way the quit ever
proceeds. Re-issuing app.quit() after before-quit's preventDefault() is a
known intermittently-unreliable Electron behavior (electron/electron#4994,
#33643, #39094); when it no-ops, or shutdown hangs (a stuck
'omnigent server stop'), the app stays up with its window still open —
matching 'sometimes the app is still running and refuses to quit'.
- Hard safety cap: app.exit(0) after quitCleanupTimeoutMs (unref'd) if
graceful cleanup + the re-issued quit haven't terminated. Normal cleanup
(<6s) completes well under the 10s cap; it only trips when stuck.
- Evaluate resolvedCliPath() inside an async IIFE so a future throw becomes
a rejection caught by .catch, never stranding the quit.
- Install fallback: when quitAndInstallIfPending() returns true but
quitAndInstall() doesn't actually quit (staged update gone), a short
app.exit(0) fallback still quits.
- unref() the periodic update-check setInterval so it can't keep the event
loop alive at quit.
Adds two regression tests (install-fallback and cleanup-cap) via an
injectable setQuitTimeouts; harness exposes setTimeout/clearTimeout/app.exit.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
The codex-native launch read the spec model only from
executor.config["model"], a key the single-file agent loader never
populates, so a custom agent's declared model: was silently replaced by
the provider default. Read the canonical executor.model first — the same
field the in-process harness and the claude/cursor native launches
consume — and keep config["model"] as a fallback for bundle specs that
pin the model inside the harness config block.
Co-authored-by: Isaac
* fix(loader): reject the bundle type:/config: nesting in single-file executor blocks
A single-file agent YAML written with the bundle config.yaml shape
(executor: {type: omnigent, config: {harness: ...}}) loaded without
complaint: the unknown keys were silently dropped, the declared harness
with them, and a different harness was inferred from the model prefix —
databricks-gpt-* landing on openai-agents instead of the declared
codex-native, with no diagnostics. Reject exactly type:/config: with an
error that shows the flat spelling. Other extra executor keys
(use_responses, extra, ...) keep loading — the compat loader reads them
from the raw YAML.
Co-authored-by: Isaac
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
* test: spell e2e fixture executors flat instead of the bundle config: nesting
Six runtime-generated single-file agent YAMLs in the e2e/e2e_ui/server
fixtures nested the harness under executor.config — the exact trap the
loader now rejects. They only worked because the dropped harness was
re-inferred from the gpt-* model prefix as the same openai-agents value.
Spell them flat so the declared harness actually flows. The two
spec_version bundle specs (approval agent, elicitation supervisor) keep
the nesting — config.harness is the correct spelling on the strict
parser path.
Co-authored-by: Isaac
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
---------
Signed-off-by: Dhruv Gupta <dhruv.gupta@databricks.com>
The background server spawned by bare `omni` (`_spawn_local_server`)
launched `omnigent.cli server` without `--config`, so the server's
loader returned an empty config and never read `~/.omnigent/config.yaml`.
Its `llm:` (and `policies:`) block was invisible to the detached server,
so self-hosted smart routing silently stayed off (`sys_advise_models` ->
`router_on: false`; `/v1/info` -> `smart_routing_enabled: false`).
Forward `--config <global_config_path()>` when the file exists. Same bug
class as #2386/#2763 (Docker entrypoint dropped `policies:`); this is the
local-spawn instance.
Co-authored-by: Isaac
Signed-off-by: Pranav Setlur <psetlur@gmail.com>
PR #3148 extracted _session_labels_for_runner_spawn into
omnigent.runner.native.orchestration, but _SESSION_STREAM_HEARTBEAT_S
and the stream loop that reads it remained in omnigent.runner.app.
test_session_stream_emits_heartbeat_on_idle located the module to patch
via _session_labels_for_runner_spawn.__module__, which now resolves to
omnigent.runner.native.orchestration — a module that has no
_SESSION_STREAM_HEARTBEAT_S attribute — so the test raised
AttributeError and failed CI on main.
Patch omnigent.runner.app directly, which is where the heartbeat cadence
constant and its consumer actually live.
Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
When the launching process sets CLAUDE_CODE_USE_GATEWAY=1, that
gateway-aware mode keeps tool search enabled so MCP schemas load on
demand. Setting CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS alongside it
would override that mode, disabling all betas and inflating startup
token usage.
Only set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS when gateway-aware
mode was NOT selected.
Ported from databricks-eng/universe#2298829.
Co-authored-by: harry-yao_data <harry.yao@databricks.com>
Introduce no-op extension points on the conversation store so a subclass
can transform conversation_items.data and control search_text, without
changing OSS behavior:
- _encode_item_data(data_json): identity by default; append's data write is
routed through it so a subclass may compress or encrypt the payload.
- _decode_item_data_batch(stored_list): identity by default; the read paths
(list_items, list_latest_message_items_for_conversations, the FTS-ranked
read) decode a whole page of rows through it before building entities, and
_to_item now takes the already-decoded data. Making the read seam a batch
(not a per-row hook) lets a subclass decode a page in one pass — e.g. a
single bulk decrypt — instead of once per row.
- _item_search_text(item): extracts the search text as before by default;
may return None to skip persisting search_text (and its FTS row) on a
schema that omits the column.
Every default preserves current behavior exactly: the column stays plaintext
Text, and search/FTS are unchanged. This lets a downstream store (Databricks'
MySQL-homed conversation store) envelope-encrypt item payloads at the column
boundary while reusing append/list_items unchanged.
Co-authored-by: Isaac
Signed-off-by: aravind-segu <aravind.segu@databricks.com>
* docs(deploy): correct docker admin bootstrap flow (no auto-generated password)
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
* docs(deploy): correct remaining generated-password and /data-persistence claims
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
* docs(deploy): scrub generated-password flow from remaining platform guides
The Docker docs were corrected earlier, but fly / railway / render / modal /
hf-spaces still told operators to read a generated admin password out of the
logs / /data/admin-credentials — a flow that no longer exists (bootstrap never
auto-generates a password; the first admin is claimed via the web Create-admin
form or a pre-seeded OMNIGENT_ACCOUNTS_INIT_ADMIN_PASSWORD).
- Rewrite the first-admin step in each guide to the real flow, and drop the
fake "Created initial admin ... password: <generated>" log block.
- Add a first-visitor security note (unauthenticated /auth/setup while no
password-bearing account exists) to every public-facing guide; fold it into
hf-spaces' "make the Space Public" step where the exposure is most direct.
- render: correct the disk bullet (hashes live in Postgres, not on /data) and
the render.yaml comment that called the anchor path a password file.
Co-authored-by: Isaac <isaac@example.com>
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
---------
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Signed-off-by: Pat Sukprasert <pattara.sk127@gmail.com>
Co-authored-by: Pat Sukprasert <pattara.sk127@gmail.com>
Co-authored-by: Isaac <isaac@example.com>
2026-07-23 16:11:36 +00:00
582 changed files with 95722 additions and 68545 deletions
--body "Automated version bump via \`.github/workflows/bump-version.yml\` (mode: \`${MODE}\`, input: \`${NEW_VERSION}\`).
Rewrote \`[project].version\` and sibling \`==\` pins across all three packages (\`pyproject.toml\`, \`sdks/python-client\`, \`sdks/ui\`), the runtime \`VERSION\` constant in \`omnigent/version.py\`, and regenerated \`uv.lock\`.
Rewrote \`[project].version\` and sibling \`==\` pins across all four packages (\`pyproject.toml\`, \`sdks/python-client\`, \`sdks/ui\`, \`integrations/slack\`), the runtime \`VERSION\` constant in \`omnigent/version.py\`, and regenerated \`uv.lock\`.
Generated by \`scripts/update_versions.py\`. Opened via the omnigent-ci App when configured (CI runs automatically); on the GITHUB_TOKEN fallback, re-open or push to kick CI."
echo "2. Validate the rc from PyPI (see RELEASING.md). The GitHub draft for ${TAG} stays unpublished."
echo "2. Validate the rc from PyPI (see RELEASING.md). No GitHub release is created for rc tags (rcs live on PyPI only) — skip straight to the next rc or the final cut."
else
echo "2. Merge the CHANGELOG PR, curate the ${TAG} draft notes, then dispatch finalize-release.yml (tag=${TAG})."
fi
@@ -657,7 +657,6 @@ jobs:
# never re-freezes and doc-sync keeps deriving the right X.Y-docs branch.
--body "🔁 \`/rerun\`: no failed CI runs on the current head (\`${SHA:0:7}\`) to re-run. If a check is stuck *pending*, it needs a push or a maintainer, not a re-run."
exit 0
fi
RERAN=""
while IFS=$'\t' read -r id name; do
[ -n "$id" ] || continue
echo "• Re-running failed jobs in '$name' (run $id)"
# --failed: re-run only the failed jobs (cheapest path for a flake).
# --repo is REQUIRED: this job has no checkout, so `gh run rerun`
# cannot infer the repo from a git remote and would fail client-side.
if gh run rerun "$id" --repo "$REPO" --failed; then
RERAN="$RERAN"$'\n'"- $name"
else
echo "::warning::Could not re-run '$name' (run $id) -- may be in progress."
RERAN="$RERAN"$'\n'"- $name ⚠️ (skipped: already running or not re-runnable)"
fi
done < <(printf '%s\n' "${FAILED[@]}")
NOTE="The \`Merge Ready\` gate re-evaluates automatically when these complete."
gh pr comment "$PR_NUMBER" --repo "$REPO" \
--body "🔁 \`/rerun\`: re-running failed jobs on \`${SHA:0:7}\`:${RERAN}"$'\n\n'"$NOTE"
echo "::warning::Resource resolution failed with ${TAG} only ${age_h}h old — inside pip's --uploaded-prior-to=P1D window. The nightly catch-up will open the tap PR."
echo "Deferred to the nightly catch-up (${TAG} is ${age_h}h old, inside the 24h PyPI window)." >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
exit 1
fi
echo "deferred=false" >> "$GITHUB_OUTPUT"
brew style omnigent-ai/tap/omnigent
- name:Assert the hand-maintained sections survived
@@ -5,6 +5,140 @@ generated at release time from each PR's `## Changelog` section, tagged by the
PR's `Type of change` (e.g. `[UI]`); the concise, curated highlights live on the
website under `/releases`.
## [v0.7.0] — 2026-07-27
- [Bug fix] Hermes thinking now appears in mirrored web conversations. (#1645)
- [Bug fix] Image and file attachments now survive session relaunches on remote host runners; attachments that fail to load show a visible marker instead of silently disappearing. (#2085)
- [UI / Feature] Voice dictation in the composer now works in Electron, Firefox, and Chromium via optional server-side transcription (`omnigent[dictation]`) — local models, live streaming partials, audio never leaves your server. (#2093)
- [UI / Bug fix / Test/CI] Hide Claude task completion control messages from conversation history while preserving them for resume context. (#2104)
- [Bug fix / Feature / Docs] Operators can mount pre-created PersistentVolumeClaims (NFS/SMB/SAN) into Kubernetes sandbox runners via `sandbox.kubernetes.pvc_mounts` (read-only by default) (#2435)
- [Bug fix / Test/CI] `/compact` no longer races when multiple compact requests hit the same session at once (#2585)
- [Bug fix / Test/CI] `sys_call_async` / `sys_cancel_async` now consistently use `handle_id` as the cancel identifier. (#2586)
- [Bug fix / Test/CI] Runner idle timeout no longer kills sessions waiting on async tools, timers, or approval prompts (#2588)
- [Bug fix] Misconfigured runner tool policies deny tool calls instead of silently allowing them (#2589)
- [UI / Feature] Slash-command menus now match any part of a command's name, so `/using-superpowers` finds `/superpowers:using-superpowers` (#2655)
- [Bug fix] Host-launched runners now reuse delegated credentials instead of repeating Databricks authentication during startup. (#2762)
- [Feature] Projects are now a first-class entity with a `/v1/projects` CRUD API (create, list, rename, delete) and per-session membership. (#2765)
- [Feature] `omni usage` reports your LLM cost for today / the last 7 / 30 days, with a per-session per-model cost breakdown (#2787)
- [Feature / Chore] Native Claude sessions start faster by coalescing runner initialization into one handshake. (#2793)
- [UI / Bug fix / Feature / Docs / Test/CI] Claude-native launch and in-session pickers now share the selected host's live model catalog, including Claude Code's managed routes. (#2831)
- [Bug fix] Managed BoxLite sandboxes remain available after provisioning so agent launches can execute commands reliably. (#2846)
- [Feature] Server-side smart routing can now call an external `routes:select` router via `routing.provider: external`, with provider-agnostic auth (`api_key`) and model-name mapping (`model_prefix`) (#2864)
- [UI] Chat code blocks no longer load the syntax-highlighter engine until the first (#2886)
- [UI / Bug fix] The main chat "Working…" indicator now clears reliably when the session goes idle, instead of occasionally staying lit after a reply completes. (#2900)
- [Bug fix] The performance benchmark harness now records HTTP failures and continues the rest of the suite instead of aborting, and excludes fully-failed runs from the summary averages. (#2917)
- [Feature / Test/CI] Scheduled tasks can now be created without a workspace or a pinned host for non-code work (research, summaries, chat-only, MCP-only); an unset host runs on your live host at fire time, and an unset workspace defaults to the host's home directory. A pinned host is now authorized (existence + ownership) at create time rather than only at fire time. (#2946)
- [Feature] Set `OMNIGENT_CONTAINER_RUNTIME=podman` to use Podman (or another supported runtime) globally instead of Docker, without editing every agent's YAML. (#2949)
- [Bug fix] Sending a message to a session whose Claude Code terminal crashed no longer (#2951)
- [Bug fix] The desktop app now always quits within a few seconds even if its background cleanup stalls or the OS re-quit is dropped. (#2972)
- [UI / Bug fix] Messages send immediately when a session's only remaining work is a background job, instead of being held in the queue until it finishes (#2974)
- [UI / Feature] Desktop update notifications now appear in a native corner toast that works (#2975)
- [Bug fix / Chore] Runner startup no longer waits several seconds for Git's optional untracked-file cache probe. (#2976)
- [UI / Bug fix] Pi sessions now show reasoning while it streams and after conversation history reloads. (#2979)
- [Feature] The runner log now records why the runner exited (crash traceback, signal, idle timeout, tunnel close, or parent death) (#2985)
- [UI / Feature] Set up a missing agent from the New Chat dialog with a guided, step-by-step checklist (#2987)
- [UI / Bug fix / Feature] HTTP headers can now be set and edited for HTTP MCP servers in the session agent info panel. (#2989)
- Capped unbounded DB list queries in the permission store and reduced session opens in `check_access`/`get_permission_level` from 2–3 to 1. (#2995)
- Deleting a conversation with many descendants now issues a single FTS DELETE instead of one per descendant. (#2999)
- [UI / Bug fix] Android auto theme and system-bar icons now stay readable with both device themes and explicit in-app theme overrides. (#3006)
- [UI / Feature] 3D model files (STL, 3MF, OBJ) now render an interactive preview in the file browser (#3007)
- [UI / Bug fix] Subagents panel Graph View now shows the same status dot colors as List View (#3009)
- [Feature / Test/CI] Scheduled-task runs now transition to a terminal state (`succeeded`/`failed`) as soon as the dispatched turn finishes, instead of staying `running` forever; run history is readable at `GET /v1/scheduled-tasks/{id}/runs`. (#3014)
- [Feature / Chore] When enabled, new sessions receive concise semantic titles in the background without adding work or latency to the active agent turn. (#3024)
- [Feature] Offload dictation speech-to-text to a remote worker with (#3025)
- [Bug fix / Docs / Test/CI] Codex-native subagents now appear in the Agents panel with their live conversations. (#3028)
- [Bug fix] Credential proxy no longer attaches injected credentials to TRACE/OPTIONS requests, and the egress proxy now honors Max-Forwards as a conformant intermediary. (#3029)
- [Feature] Import local Qwen, Kiro, Pi, and Kimi coding chats into Omnigent (#3032)
- [UI / Feature] Press ⌘⌥V (Ctrl+Alt+V) to toggle voice dictation from anywhere; while dictating, Enter keeps the text and Esc discards it (#3044)
- [UI / Feature] Added: "Auto · smart routing" harness option in the new-chat picker — lets the intelligent router pick both harness and model based on the task description (#3045)
- [Feature] Import existing OpenCode chats, including files and tool activity, with `omnigent import` (#3046)
- [Bug fix] Dictation streams now reliably release their worker slot when a browser disconnects abruptly. (#3048)
- [UI] New-session composer moves harness configuration into a gear-icon modal, with a cleaner agent picker (needs-setup and custom agents folded into flyouts) and Smart Routing offered as a model option. (#3050)
- [Bug fix / Feature] The Slack bot can now run against an Omnigent server deployed on Databricks Apps, (#3051)
- [Feature] Sessions can now be filed into first-class projects via `PATCH /v1/sessions/{id}` and listed with `GET /v1/sessions?project=<name>`, which dual-reads first-class membership and legacy project labels. (#3053)
- [Bug fix / Test/CI] Fixed SDK session telemetry always recording `harness: null` in server deployments not started via the CLI. (#3054)
- [Bug fix] Databricks OAuth CLI profiles no longer fail with a misleading "malformed profile" error; the message now explains the real fix (install `omnigent[databricks]` or refresh the OAuth session). (#3059)
- [Bug fix] An idle runner shutting down after inactivity no longer shows a scary "disconnected" error — just send a message to wake it back up. (#3060)
- [UI / Feature] The sidebar now uses first-class projects: create empty projects, rename and delete them, and file sessions into them — while existing label-based projects keep working. (#3061)
- [UI / Bug fix] The "Host is offline — click to reconnect" prompt now appears in the composer's host badge instead of a separate banner below the composer (#3062)
- [Test/CI] N/A (test-only change) (#3063)
- [Feature / Docs / Test/CI] New `databricks_cli` credential-proxy type lets sandboxed agents use the Databricks CLI without the real token entering the sandbox (#3080)
- [UI / Feature / Test/CI] Polly sessions running on Claude SDK can start Goal mode from the chat composer. (#3084)
- [UI / Bug fix] The Configure agent modal's footer no longer shows a gray background band behind Cancel/Save (#3089)
- [UI / Feature] The Sidebar is more compact and polished, with clearer status indicators and richer session details on hover. (#3092)
- [UI] Reordered the project-folder header buttons (new-session before the menu), (#3096)
- [Chore / Breaking] `omni server start` is removed; use `omni server --background` to launch the (#3105)
- [Bug fix] `omnigent server --host 0.0.0.0` now enables accounts (login) mode automatically instead of silently 401-ing every request (#3107)
- [Feature] Projects can store default session settings (host, workspace, harness, model, …) via a new `config` field on the projects API. (#3108)
- [Bug fix] Databricks-served Claude models no longer break non-streaming responses (prompt-policy and smart routing) when returning typed content blocks (#3109)
- [Feature] `omnidev omnigent <args…>` runs an omnigent command against the current checkout's pod via `uv run omnigent`, with the pod's isolated env applied (#3110)
- [UI / Feature] Configure a session's model, effort, and smart routing mid-chat from a new gear icon in the composer (#3111)
- [UI / Feature / Test/CI] Add the `/tasks` Scheduled Tasks page with sidebar navigation, task rows, empty states, suggestion chips, create-dialog entry points, and Playwright E2E coverage. (#3112)
- [Bug fix] Reading image files in a Claude Code native session no longer bloats conversation history and breaks resume/compaction on large sessions (#3113)
- [Bug fix / Test/CI] The iOS app no longer follows cross-origin redirects when probing a newly approved server for the Databricks workspace mount, so a consented host can't redirect the probe to a different origin. (#3115)
- [Bug fix] Forked native sessions (Claude Code, Codex, Pi, Qwen) again resume with their prior conversation history. (#3116)
- [UI / Feature / Test/CI] Workspace pane icons now explain themselves on hover, with a cleaner right-side session layout and compact Share action. (#3122)
- [UI / Bug fix / Feature] Add a dialog for creating recurring scheduled agent tasks. (#3123)
- [UI] Sidebar session hover flyouts and rows now align with the project rows — matching flyout style, title size, and right-edge padding. (#3124)
- [Bug fix] Resuming a session with large images stored in history no longer overflows the context window or breaks compaction, on both the SDK and native Claude Code paths (#3133)
- [Feature] `omnigent session import` loads a `session export` JSONL back into a server as a new session (#3141)
- [Feature] Telemetry now records the agent name for Polly and Debby sessions. (#3152)
- [Chore / Breaking] `omni integration slack start` is removed; use `omni integration slack --background` to launch the (#3153)
- [UI / Bug fix / Docs / Chore] Slack device login now requires a fresh password at the consent screen, closing a device-code phishing gap where an already-signed-in user could approve a login by reflex. (#3156)
- [Feature] `omnigent claude` keeps tool search enabled when launched with `CLAUDE_CODE_USE_GATEWAY=1`. (#3161)
- [Test/CI] Fix `test_session_stream_emits_heartbeat_on_idle` after `_session_labels_for_runner_spawn` was extracted into `omnigent.runner.native.orchestration`; patch the heartbeat cadence on `omnigent.runner.app` where it is defined and consumed. (#3163)
- [Bug fix] Crash reports are no longer lost when a process crashes more than once in the same second. (#3173)
- [Bug fix] Custom codex-native agents launch on the model declared in the agent spec (`executor.model`) instead of silently falling back to the provider default (#3175)
- [Bug fix] Single-file agent YAMLs that nest the executor under `type:`/`config:` (the bundle config.yaml shape) now fail at load time with the correct flat spelling, instead of silently running a harness inferred from the model prefix (#3178)
- [UI / Bug fix / Feature] Use native Codex goal mode from Polly's Goal control (#3181)
- [UI / Bug fix] Renaming a session now updates the name in the sidebar instantly instead of after a short delay. (#3185)
- [UI / Bug fix / Feature / Test/CI] Edit scheduled tasks and type exact run times, with a scrollable time picker and a consistent, fully-visible dialog. (#3186)
- [UI / Feature] Pinned sessions now persist server-side per user, so pins follow you across devices and browsers. (#3189)
- [Feature] New sessions now receive concise semantic titles automatically without additional configuration. (#3191)
- [Test/CI] `/rerun` PR comment re-runs failed CI on the current commit without dismissing approvals (#3195)
- [Feature] Native Codex sessions can now receive concise automatic background titles. (#3199)
- [Bug fix] Qwen3, inkling, and other non-OpenAI models now work in the Pi SDK executor harness (#3203)
- [Chore / Breaking] Slack-on-Databricks deploy: renamed `OMNIGENT_SLACK_WEBAUTH_BASE_URL` to `OMNIGENT_SLACK_DATABRICKS_APP_URL` (`--app-url`), removed the `WEBAUTH_PORT` / `DATABRICKS_WORKSPACE_HOST` overrides, and dropped deploy-time `uv lock` in favor of in-container `uv run`. (#3206)
- [UI / Bug fix] Sidebar session titles use the available space cleanly and reveal branch and action details only when needed. (#3208)
- [UI / Bug fix] Removed the redundant "Create new project" option from the sidebar project picker — create projects with the + icon next to Projects (#3210)
- [Feature] Smart routing now activates automatically when a server `llm:` block or an external `routing:` block is configured — no `OMNIGENT_SMART_ROUTING` env var needed (#3215)
- [UI / Feature / Test/CI] Scheduled task rows now show when each task will next run ("Next run in 15h") and a "Run now" action in the ⋯ menu to fire a task immediately, with refreshed row styling. (#3218)
- [UI / Feature] Projects now carry default session settings (host, working directory, agent, optional git worktree) that pre-fill the new-session composer. (#3221)
- [Bug fix] Fixed per-model cost attribution for native harnesses so a session's per-model (#3223)
- [UI / Bug fix] Codex task plans now stay in Tasks instead of being duplicated in chat. (#3249)
- [UI / Bug fix] Smart Routing no longer appears in the model dropdown for native terminal sessions (Claude Code, Codex, Pi), where it had no effect (#3259)
- [Bug fix] Sandboxed agents can now run tools managed by update-alternatives (awk, python3, editor, and similar) on Linux. (#3263)
- [Bug fix] Egress proxy now trusts corporate/MDM CA roots installed under the system `capath` directory, so TLS to hosts behind a corporate MITM works from a sandboxed agent. (#3264)
- [Bug fix] Large historical attachments no longer inflate replay and compaction context as inline base64 text. (#3267)
- [Docs] Contributors can now use `omnidev` as the documented worktree-safe local testing flow. (#3277)
- [Bug fix] Custom OpenAI Agents can use Unity AI Gateway Model Services with fully qualified model names when a Databricks provider or profile is configured. (#3288)
- [UI / Bug fix / Feature] Configure recoverable dangerous shell commands to ask for approval or deny execution, while always blocking catastrophic operations. (#3297)
- [Bug fix / Feature] Pi harness now routes kimi, inkling, GLM, qwen3, Gemini 3+, and Llama through the correct AI Gateway endpoints, fixing "Stream ended without finish_reason" errors and ensuring `system.ai.*` ids are used throughout. (#3307)
- [Feature] Add a top-level `justfile` with recipes for launching the iOS Simulator, running the Android debug build, starting the omnigent dev pod, and running pre-commit/lockfile normalization. (#3310)
- [UI / Bug fix] Sidebar header action buttons are now vertically centered with section titles. Session row hover is smoother, and active items no longer flash when hovered. (#3311)
- [UI / Bug fix] Aligns project folder icons and color with the rest of the sidebar. (#3317)
- [Bug fix] Unsupported Claude Code slash commands are now escaped and sent as regular user messages instead of leaving the native terminal in an undriveable state. (#3319)
- [Feature] `omnigent server` now tells users they can set `OMNIGENT_AUTH_ENABLED=0` to override automatic multi-user mode when binding to a non-loopback interface. (#3320)
- [Chore / Breaking] [Breaking] The deprecated `OMNIGENT_ACCOUNTS_ENABLED` environment variable has been removed; use `OMNIGENT_AUTH_ENABLED` instead. (#3322)
- [UI / Bug fix] Fixed pinned sessions being lost when the web UI was updated before the server. (#3323)
- [UI / Feature] Automations list: tasks now render as cards and show a live-updating relative next-run time ("Next run in 3 hours"). (#3324)
- [UI] Settings → Appearance no longer has a separate Sidebar font size control, and a new "Reset to defaults" button restores every appearance preference after confirmation. (#3326)
- [UI] Starting a session inside a project now names the project in the new-session (#3327)
- [UI] The Files workspace tab now uses a stacked-files icon. (#3329)
- [UI / Feature] Automations: scheduled tasks can now pick a model and reasoning effort in the create/edit dialog (defaults to the agent's settings). (#3331)
- [UI / Bug fix] Fixed sessions pinned in the updated web UI being lost after the server was updated. (#3332)
- [UI / Feature] Native harness setup now checks the installed CLI version and prompts to upgrade if it is too old. Cursor's missing-binary case is normalized to the same structured `binary-missing` signal as the other CLI-backed native harnesses. (#3335)
- [Bug fix] Pi sessions now show a clear error when their Databricks login has expired, instead of silently accepting messages with no reply (#3336)
- [Test/CI] N/A (internal CI change). (#3338)
- [Bug fix] claude-sdk harness now surfaces harness-level failures (expired login, auth error) as structured errors instead of storing them as assistant messages. (#3342)
- [UI] Align the sidebar brand row with the rest of the navigation. (#3346)
- [UI / Bug fix] Short links like `#3090` in chat markdown tables no longer stack one character per line (#3350)
| `in_cluster` | Optional cluster-config source: `true` (in-cluster SA only), `false` (kubeconfig only), omit (try in-cluster, then kubeconfig). |
| `kubeconfig` | Optional kubeconfig path for the out-of-cluster fallback (env: `OMNIGENT_KUBERNETES_KUBECONFIG`). |
| `pvc_mounts` | Optional pre-created PersistentVolumeClaims mounted into every runner Pod — see [Persistent storage mounts](#persistent-storage-mounts-pvc_mounts). |
## Persistent storage mounts (`pvc_mounts`)
Runner Pods are ephemeral by design — the workspace lives on an `emptyDir` and
dies with the Pod. To expose durable data (datasets, model caches, shared
output directories) mount pre-created PersistentVolumeClaims:
1. Create the PV/PVC **in the runner namespace** (`omnigent-sandboxes`) out of
band — via your GitOps repo, with whatever backend your cluster provides
(NFS/SMB CSI drivers, SAN, cloud disks). Omnigent only references the claim;
it never creates volumes, so the server RBAC stays unchanged.
2. List the claims under `sandbox.kubernetes.pvc_mounts` (see
`sandbox-config.yaml`). Mount paths may not overlap `/home/omnigent`, the
OS directories, or their ancestors (e.g. `/home`, `/var`) — the server
rejects such config at startup.
Caveats:
- **Multiple runners share writable claims concurrently** — use a
`ReadWriteMany`-capable backend (NFS/SMB/CephFS) for anything writable, and
prefer `read_only: true` (the default) everywhere else: a writable shared
mount lets one session's agent read and modify what another session wrote,
and anything written there outlives the Pod and its launch token.
- Runner Pods run as uid/gid 1000660000 with `fsGroup`. NFS `root_squash` and
SMB ownership mapping must permit that identity (export to the uid, or use
CSI mount options like `uid=`/`gid=` for SMB); `fsGroupChangePolicy:
OnRootMismatch` avoids re-chowning large exports on every start.
-`ReadWriteOnce` claims pin all runners to one node — combine with
`node_selector` deliberately, or the second Pod sits `Pending`.
- A mount visible in the Pod is not automatically visible to a harness's own
OS-level sandbox (OmniBox path grants are separate).
To verify `host_config` end to end against a live cluster, run
3. Slack server shows the verification link in the setup modal (initiator
only). The device_code is NOT included — it never leaves the server
pair; only the user_code (in verification_uri_complete) does.
3. Slack server shows the verification link (verification_uri_complete,
code prefilled for one-click) in the setup modal (initiator only),
plus the user_code so the user can confirm the match. The
device_code is NOT included — it never leaves the server pair.
4. User clicks → Omnigent consent page (verification_uri).
Browser authenticates via the server's accounts provider.
Page shows: "<client_id> is requesting permission to act as YOU
(alice@example.com) on this Omnigent server. [Approve] [Deny]"
plus a warning to approve only a login the user personally started.
The page REQUIRES a login started for THIS flow: if the browser's
session predates the grant (session iat < grant.created_at), it
bounces through the login page with ?reauth=1 — which forces a fresh
password entry even for an already-signed-in user — and returns here.
Once re-authenticated, the page shows: "<client_id> is requesting
permission to act as YOU (alice@example.com) on this Omnigent server.
[Approve] [Deny]" plus a warning to approve only a self-started login.
The forced re-auth means a grant can't be approved by one reflexive
click on a link the user didn't personally start (see threat #2).
5. User approves → the grant is bound to the authenticated identity
(alice@…). client_id is recorded for display/audit only, never as
@@ -197,9 +189,8 @@ cli-ticket flow and never mounts these routes; header mode has no
server-mintable identity — see `create_device_auth_router`, which raises if
constructed for any other source). The `device_grants` table is created
unconditionally by the migration regardless of the flag; only the router
mount is gated. This router also **owns**`mint_delegated_token` and
`DELEGATED_SCOPE` (moved here from `oidc.py`, which retains only
`mint_session_token` / `mint_session_cookie`).
mount is gated. This router **owns**`mint_delegated_token` and
`DELEGATED_SCOPE`.
-`POST /oauth/device/authorize` — **public** (rate-limited). Generates a
high-entropy `device_code` (`secrets.token_urlsafe`, stored **hashed**), a
@@ -275,9 +266,8 @@ HS256 shape (so `_check_cookie` accepts them) plus four delegated-only claims:
## Slack-side changes
- **`oauth.py` (new)** — device-authorize → post ephemeral link → poll token
endpoint (respecting `interval` / `slow_down`) → store tokens. Replaces the
`AuthRequiredError` dead-end.
- **`oauth.py`** — device-authorize → post ephemeral link → poll token
endpoint (respecting `interval` / `slow_down`) → store tokens.
- **`omnigent.py`** — attach `Authorization: Bearer` per
`(server_url, slack_user_id)`; on 401, refresh once and retry; on refresh
failure, surface a re-login prompt. `OmnigentClientPool` keys clients by
@@ -285,8 +275,8 @@ HS256 shape (so `_check_cookie` accepts them) plus four delegated-only claims:
- **`store.py`** — new `oauth_tokens` table `(team_id, user_id, server_url)` →
access/refresh **encrypted at rest** (key from env / secret manager, never in
the DB). `/omnigent logout` → `POST /oauth/revoke` + local delete.
- **`setup.py`** — validation uses the user's token; auth-enabled servers become
supported rather than rejected.
- **`setup.py`** — validation uses the user's token, so auth-enabled servers
are supported.
- **`config.py`** — holds the local encryption key for token storage.
## Security analysis
@@ -294,7 +284,7 @@ HS256 shape (so `_check_cookie` accepts them) plus four delegated-only claims:
| # | Threat | Mitigation |
|---|--------|-----------|
| 1 | `device_code` leak → token theft | Never transits Slack or the user — only `verification_uri_complete` (a `user_code`) does. Stored hashed; single-use. |
| 2 | Link misdelivery / phishing another user | Link shown to the initiator only (in their own setup modal). Consent page names the exact Omnigent identity the grant will act as and the requesting `client_id`, and warns to approve only a self-initiated login. |
| 2 | Link misdelivery / phishing another user | Link shown to the initiator only (in their own setup modal). **Consent requires a login started FOR this flow: the consent page rejects a session whose `iat` predates the grant and bounces through the login page with `reauth=1`, forcing a fresh password entry even for an already-signed-in user.** So an attacker-initiated flow can't be approved by a single reflexive click — the victim must deliberately re-enter their password against a screen naming the exact Omnigent identity and requesting `client_id`. The gate is enforced on both the consent GET and the approve POST. |
| 3 | Anyone can initiate/poll (public client) | Cheap `pending` state grants nothing until an authenticated user approves. `POST /oauth/device/authorize` is rate-limited per client IP (10/60s → 429 `slow_down`); short (10 min) `device_code` expiry; `slow_down` enforced server-side on aggressive polling; expired grants purged opportunistically. |
| 5 | Compromised Slack server acts as all users (inherent to delegation) | Reduced scope (no admin), short TTL + refresh rotation, per-grant revocation, **absolute grant lifetime (30 d) enforced on refresh** so even an un-revoked grant dies, and an `act`-claim audit trail. |
@@ -315,6 +305,17 @@ token.
When no client secret is configured the endpoints are **public**, so
initiation is open — the defense is layered, not a gate:
- **Forced re-authentication at consent.** Consent requires a login started for
THIS flow: the consent page (and the approve POST) reject a session whose
`iat` predates the grant's `created_at` and bounce through the login page with
`reauth=1`, which forces a fresh password entry even for an already-signed-in
user. This defeats the reflex-approve variant of the attack — a victim handed a
one-click link (even one with the code prefilled) still can't bind the grant
without deliberately re-entering their password against a screen naming the
exact identity and client. (`device_auth.py``_session_iat` + the
`reauth=1` bounce; `LoginPage.tsx` suppresses its already-signed-in
auto-return under `reauth=1`.) The prefilled one-click link is therefore
retained for convenience — the re-auth step, not code handling, is the gate.
- The consent page prominently **warns** the user to approve only a login they
personally started and to match the code shown by the application.
- The delegated scope excludes admin / user-management endpoints.
@@ -322,6 +323,11 @@ initiation is open — the defense is layered, not a gate:
grant self-expires even if never revoked.
- Initiation is rate-limited per IP; nothing is granted until a real user
authenticates and approves in their own browser.
- **Startup warning.** When the grant is mounted on a multi-user (accounts)
server with `OMNIGENT_DEVICE_CLIENT_SECRET` unset, the server logs a loud
warning at startup that the authorize endpoint is public — nudging the
operator to opt into the secret rather than leaving initiation open unknowingly
(`app.py`, at the device-router mount).
Setting `OMNIGENT_DEVICE_CLIENT_SECRET` closes initiation entirely to
unauthorized callers: without the matching `X-Omnigent-Client-Secret` header,
| `git_https` | `Authorization: Basic b64(user:<real>)` | swap-on-access | Preset for git-over-HTTPS; nothing in the sandbox. |
| `gh_basic` | Basic for git host, `token` for api host | swap-on-access for git; `GH_TOKEN`/`GITHUB_TOKEN` env for api | Preset for GitHub CLI + git; defaults to `github.com` + `api.github.com`. |
| `databricks_cli` | `Authorization: Bearer <real>` per workspace host | placeholder `.databrickscfg` file (one `oa_cred_*` per profile) | Preset for the Databricks CLI; takes `profiles` (+ optional `default`). See below. |
Common fields: `target`/`targets` (host + optional path glob — only the
host binds the credential; path scoping is delegated to `egress_rules`),
@@ -152,6 +153,54 @@ parser) that rejects unknown keys, enforces exactly one source key, and
checks POSIX env-var names — then converts to the `CredentialSourceSpec`
1. Add `NativeHarnessProvider`, `native_providers` field, accessors, and
`omnigent/native_dispatch.py` resolver.
2. Populate the built-in contribution with one provider per native agent,
pointing at the existing `omnigent.<x>_native` functions.
3. Normalize `run_<x>_native` to the uniform keyword signature (with aliases).
4. Rewrite each hub (table above) to resolve through the registry. Delete the
`if key ==` chains and the dead `_HARNESS_MODULES` literal.
5. Derive the §5 enumerations from `native_agents()` / capabilities.
6. Keep the validator rejecting community native metadata — nothing external
yet. All existing native harnesses now run *through* the seam. This is the
correctness-critical phase; the test bar is "every native harness behaves
identically before/after."
Built-ins keep living in core but route through the generic seam. The test bar
for every PR here is **"every native harness behaves identically before/after"**
— lean on the split native test suite (#3149) and the native e2e skills. The
validator keeps rejecting community native metadata throughout Phase 1.
| PR | Scope | Key files | Depends on | Risk | Est. |
|---|---|---|---|---|---|
| **1.1 Provider model + resolver** | Add `NativeHarnessProvider` (import-path strings), the `native_providers` field + accessors, and `omnigent/native_dispatch.py` (lazy `importlib` resolver, cached per path). Populate 11 built-in providers pointing at existing `omnigent.<x>_native` functions. Purely additive — no hub rewired yet. | `harness_plugins.py`, new `native_dispatch.py` | — | Low | 1–2d |
| **1.2 Signature normalization** | Give `run_<x>_native` a uniform `extra_args` spelling with a back-compat `<x>_args` alias (one-release deprecation per CLAUDE.md — name the target release). Decide the `**extra` protocol for the four special-kwarg harnesses (claude/codex/antigravity/opencode). | 11 `omnigent/<x>_native.py`, `native_dispatch.py` | 1.1 | Low–Med (mechanical ×11) | 2–3d |
| **1.3 Resume hubs** | Collapse `resume_dispatch._dispatch_wrapper` (10 arms) and the 6 `chat.py` `_run_<x>_native_resume_redirect` helpers into one `resolve(provider.run_native)(...)` path. Deletes the redirect helpers and normalizes the 10-vs-6 coverage gap. | `resume_dispatch.py`, `chat.py` | 1.1, 1.2 | Med | 2d |
| **1.4 CLI subcommands** | Replace the 11 hand-written `@cli.command` funcs in `cli_native.py` with a loop over `native_agents()`, registering one Click command each; make `_reject_native_on_windows` a registry-driven guard. Wrinkle: per-command options (`--model`, `--command`) must come off provider/row metadata. | `cli_native.py`, `cli.py` | 1.1, 1.2 | Med | 2–3d |
| **1.5 Runner launch + terminal-route** | The epicenter. Replace spawn-env (22 arms), launch (11 + 3 elif), and terminal-route (11) dispatch in `app.py` with `resolve(provider.auto_create_terminal / spawn_env_builder)(...)`. **Preserve the `_supervise_*_bridges` forward-cursor / restart / double-post invariants exactly.** Likely splits into 1.5a spawn-env and 1.5b launch+route. | `runner/app.py`, `runner/native/orchestration.py` | 1.1, 1.2 | **High** | 4–6d |
| **1.6 Runner interrupt/stop** | Route interrupt/stop through `resolve(provider.interrupt_handler / stop_handler)`; fill the 9/7 coverage gaps so every native has both paths. | `runner/app.py` | 1.1 | Med | 2d |
| **1.7 Seeding loop** | Replace the 26 `_ensure_default_<x>_agent` / `_build_<x>_native_bundle` touchpoints in `server/app.py` with a loop materializing via `provider.materialize_agent_spec`. **`builtin_agent_id` output must stay byte-identical** so redeploy doesn't orphan seeded agents — pin this with a test. | `server/app.py`, `db/utils.py` | 1.1 | Med | 2–3d |
| **1.8 Derive enumerations** | Add a `fork_history: Literal["none","rebuild","preamble"]` axis to `HarnessCapabilities`; derive the §5 frozensets/dicts from `native_agents()` / capabilities (8 files, ~35 sets); delete the dead `_HARNESS_MODULES` literal. | `harness_capabilities.py`, `_omnigent_compat.py`, `harness_readiness.py`, `harness_install.py`, `model_override.py`, `model_catalog.py`, `_sessions/common.py`, `resource_registry.py`, `runtime/harnesses/__init__.py`, `tests/test_harness_capabilities.py` | 1.1 | Med | 2–3d |
After 1.1 + 1.2 land, PRs 1.3–1.8 touch mostly disjoint hubs and can proceed in
1. Flip `_validate_community_contribution` to positive validation.
2. Extend `GET /v1/harnesses` (`harness_catalog()`) to emit native-agent rows +
capabilities.
3. Drive the web off `/v1/harnesses`: delete the `nativeCodingAgents.ts`
literals, `forkHarness.ts`, and the `AgentCard` icon switch in favor of
server-supplied metadata (icon can be a capability/label field).
4. Document the native checklist in `designs/harness-plugin-interface.md`
(extend § "Native TUI Harnesses").
5. Ship an example native plugin (`examples/` or a sibling `omnigent-foo-native`)
to prove the contract end to end.
Only starts once Phase 1 has every built-in running *through* the seam.
| PR | Scope | Key files | Depends on | Risk | Est. |
|---|---|---|---|---|---|
| **2.1 Validator flip** | Replace the hard reject in `_validate_community_contribution` with positive validation: every `native_agent.key` has a matching `native_provider.key`; provider import paths start with `COMMUNITY_MODULE_PREFIX`; identity values don't collide (`_native_agent_identity_values` already checks this); `run_native` + `auto_create_terminal` are non-empty. | `harness_plugins.py` | 1.1 | Low–Med | 1d |
| **2.2 `/v1/harnesses` native rows** | Extend `harness_catalog()` to emit native-agent rows + capabilities (`agent_name`, `wrapper_label`, `fork_history`, icon/label field), so the web has a server source of truth. | `harness_plugins.py`, `server/routes/harnesses.py` | 1.8 | Low | 2d |
| **2.3 Web off the endpoint** | Delete the `nativeCodingAgents.ts` literals + `HARNESS_ALIASES`, the `forkHarness.ts` sets (`NATIVE_REBUILD_HARNESSES` / `PREAMBLE_FORK_HARNESSES` now come from `fork_history`), the `AgentCard` icon switch, and the wrapper-label literals in `sessionStop.ts` / `sessionCapabilities.ts` / `codexPlanMode.ts` — all driven by `/v1/harnesses`. Needs a **demo (screenshots/recording)** per CLAUDE.md; likely splits into 2.3a fork/capabilities data-plumb and 2.3b icon/label rendering. | `web/src/lib/*`, `web/src/components/AgentCard.tsx` | 2.2 | Med–High (largest FE) | 4–6d |
| **2.4 Docs + example plugin** | Extend `designs/harness-plugin-interface.md` § "Native TUI Harnesses" with the native checklist, and ship an example native plugin (`examples/` or a sibling `omnigent-foo-native`) proving the contract end to end. | `designs/harness-plugin-interface.md`, `examples/` | 2.1, 2.2 | Low–Med | 2–3d |
@@ -15,7 +15,7 @@ Dev tooling for Omnigent, in one binary with three surfaces:
A per-repo dev **pod** supervisor, as a single long-running terminal UI. It
replaces the three-terminal local dev flow (`omnigent server`, `omnigent host`,
`npm run dev`) with one process that:
`pnpm run dev`) with one process that:
- runs each checkout in an **isolated pod** — its own state dir, database,
artifacts, logs, and auto-allocated ports — so multiple worktrees never
@@ -31,7 +31,7 @@ replaces the three-terminal local dev flow (`omnigent server`, `omnigent host`,
## Build & run
Requires the repo's usual dev prerequisites (`uv` for Python, `npm` for the
Requires the repo's usual dev prerequisites (`uv` for Python, `pnpm` for the
web UI) plus a Rust toolchain.
```bash
@@ -50,9 +50,9 @@ Run it from anywhere inside the checkout — it walks up to the repo root
|---|---|---|
| server | `uv run omnigent --log-to-stderr server --host 127.0.0.1 --port <p> --database-uri … --artifact-location …` | Waited on via `GET /health`. |
| host | `uv run omnigent --log-to-stderr host --server http://127.0.0.1:<p>` | Started once the server is healthy. |
| vite | `npm run dev -- --host <host> --port <p> --strictPort` (cwd `web/`) | `OMNIGENT_URL` points its proxy at the pod's server. |
| vite | `pnpm run dev -- --host <host> --port <p> --strictPort` (cwd `web/`) | `OMNIGENT_URL` points its proxy at the pod's server. |
Before Vite starts (and on a manual Vite restart), omnidev runs `npm install`
Before Vite starts (and on a manual Vite restart), omnidev runs `pnpm install`
in `web/` when needed — `node_modules/` is missing, or `package.json` /
`package-lock.json` is newer than it — so a fresh checkout or a new dependency
doesn't make Vite fail its dependency scan. Output streams into the `vite` pane.
@@ -65,7 +65,7 @@ Only Omnigent's own state is isolated per pod — enough that concurrent pods
never share a database, server pidfile, or `config.yaml` — via
`OMNIGENT_DATA_DIR`, `OMNIGENT_DATABASE_URI`, `OMNIGENT_URL`, and
`OMNIGENT_CONFIG_HOME`. Everything else (your real `HOME`, credentials, and
uv/npm caches) is inherited, because the agents Omnigent runs need it. This is
uv/pnpm caches) is inherited, because the agents Omnigent runs need it. This is
deliberately lighter than the hermetic `scripts/backend-smoke.sh` sandbox,
which repoints `HOME`/`XDG_*` to touch nothing real.
@@ -192,9 +192,9 @@ omnidev shell-hook # print the daily-check snippet for your shell rc
extras), `--repo <url>`. The choice is saved to
`${XDG_CONFIG_HOME:-~/.config}/omnidev/install.toml` so `update` reuses it.
Installing from git **builds the web UI from source**, so Node 22+/npm must be
Installing from git **builds the web UI from source**, so Node 22+/pnpm must be
on PATH (the PyPI wheel ships the UI prebuilt; the git install does not).
`omnidev install` fails early with a clear message if `uv` or `npm` is missing.
`omnidev install` fails early with a clear message if `uv` or `pnpm` is missing.
| 3 | Verify the build: `npm ci && npm run build && npm run package` → valid `.vsix` | local / CI | — (done) |
| 3 | Verify the build: `pnpm install --frozen-lockfile && pnpm run build && pnpm run package` → valid `.vsix` | local / CI | — (done) |
| 4 | Release-PR workflow bumps version + CHANGELOG; a manually-dispatched release workflow builds the `.vsix` and attaches it (+`.sha256`) to a draft GitHub release | `.github/workflows/vscode-release-pr.yml`, `vscode-extension-release.yml` | — (done) |
| 5 | Ask DECO to register `omnigent-vscode` under the `databricks` publisher + add dedicated `OMNI_VSCE_TOKEN` / `OMNI_OVSX_PAT` secrets (and an `omnigent-vscode-marketplace` environment for the reviewer gate) | Slack `#dev-ecosystem-discuss` ([https://databricks.slack.com/archives/C01KSAWFXG8/p1782971196701749](https://databricks.slack.com/archives/C01KSAWFXG8/p1782971196701749)) | human approval |
| 6 | Add an `omnigent-vscode.yml` publish workflow in the secure repo, adapting the existing [`databricks-vscode.yml`](https://github.com/databricks/secure-public-registry-releases-eng/blob/main/.github/workflows/databricks-vscode.yml) (SAML SSO required) — it already does download → scan → `vsce publish` + `ovsx publish` in one workflow | `secure-public-registry-releases-eng` | DECO grant (step 5) |
comes from the environment and the `.env` file — the CLI only launches the bot.
comes from **real environment variables** — the bot does **not** read a `.env`
file itself. For local dev, either export the vars, or launch under a tool that
injects a `.env` — e.g. `uv run --env-file .env omni integration slack`, or
`export $(grep -v '^#' .env | xargs)` before running. In production the
Docker / Databricks deploy sets them directly. `.env.example` documents the
full set of variables to copy from.
The bot lives in the separate `omnigent-slack` package, which must be installed
**in the same environment as**`omni` for the `omni integration slack` commands
@@ -104,7 +112,7 @@ to find it. Install it as the `slack` extra of omnigent:
uv tool install "omnigent[slack]"# or, from a source checkout: uv sync --extra slack
```
Set `LOG_LEVEL=DEBUG` in `.env` when diagnosing why Slack events are not producing replies.
Set `LOG_LEVEL=DEBUG` in the environment when diagnosing why Slack events are not producing replies.
## Per-user setup flow
@@ -140,8 +148,12 @@ command.
The bot **auto-detects the server's auth mode** (an unauthenticated `GET /v1/me`, exactly as the `omnigent login` CLI does) and picks the matching flow:
| `OMNIGENT_SLACK_DATABRICKS_SCOPES` | inline (optional) | Requested scopes (default `all-apis`; must be a superset of the server app's scopes; `openid` + `offline_access` forced on) |
| `OMNIGENT_SERVER_URL` | `--server-url` | Omnigent server the bot drives |
| `OMNIGENT_SLACK_WEBAUTH_BASE_URL` | `--webauth-base-url` | This app's public URL — link base + redirect URI |
| `OMNIGENT_SLACK_DATABRICKS_APP_URL` | `--app-url` | This app's public URL — link base + redirect URI |
| `OMNIGENT_DATA_DIR` | inline | Ephemeral SQLite store dir |
| `DATABRICKS_APP_PORT` | Databricks runtime | Port the callback server binds (8000) |
@@ -218,13 +212,12 @@ Environment wired by `databricks.yml` (secrets via `value_from`, rest inline):
| Symptom | Cause | Fix |
| --- | --- | --- |
| `ModuleNotFoundError: No module named 'omnigent_slack'` | The wheel/`pyproject.toml`/`uv.lock` were git-ignored, so `bundle deploy` didn't sync them | Ensure `src/*.whl`, `src/pyproject.toml`, `src/uv.lock` are untracked but NOT git-ignored; re-run `deploy.py` (not `--skip-build` on a clean `src/`) |
| `uv lock` fails with a PyPI DNS error | Public PyPI blocked on the Databricks network | Re-run with `UV_INDEX_URL=https://pypi-proxy.cloud.databricks.com/simple` |
| App install fails; `/logz` shows an `exclude-newer` re-resolve then a PyPI timeout | Runtime's uv `exclude-newer` cutoff differs from the lock's | Read the cutoff from `/logz` and pass it via `--exclude-newer <cutoff>`, then redeploy |
| `ModuleNotFoundError: No module named 'omnigent_slack'` | The wheel/`pyproject.toml` were git-ignored, so `bundle deploy` didn't sync them | Ensure `src/*.whl`, `src/pyproject.toml` are untracked but NOT git-ignored; re-run `deploy.py` (not `--skip-build` on a clean `src/`) |
| App fails to boot; `/logz` shows a `uv run` resolve error or PyPI timeout | Dependency resolution runs in-container at boot; the runtime couldn't reach PyPI | Confirm the app egress can reach PyPI (or the Databricks proxy); retry the `bundle run` |
| Sign-in ends on an OAuth error page (redirect mismatch) | The OAuth app's redirect URI ≠ `<this-app-url>/auth/callback` | Register the exact `/auth/callback` URL on the custom OAuth app |
| Sign-in page says the link was already used or expired | The redirect was replayed, or the bot restarted between link-issue and callback (in-memory PKCE verifier lost) | Run `/omnigent` again for a fresh link |
| Enrolled, but turns fail auth against the server | User lacks access to the server app, or the token's scopes don't satisfy the server proxy | Grant the user server-app access; widen `OMNIGENT_SLACK_DATABRICKS_SCOPES` if the server proxy needs more |
| App boots but Slack shows no sign-in link | `--webauth-base-url` not passed (the app URL only exists after first deploy) | Re-deploy with `--webauth-base-url "$(databricks apps get <app> -o json | jq -r .url)"` |
| App boots but Slack shows no sign-in link | `--app-url` not passed (the app URL only exists after first deploy) | Re-deploy with `--app-url "$(databricks apps get <app> -o json | jq -r .url)"` |
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.