Commit Graph
116 Commits
Author SHA1 Message Date
Wenxi 5858a6767e fix(craft): preserve approval outcomes and report expired requests (#16180)
## Description

Use one decision endpoint for Approve once, Approve for session, and
Reject. Concurrent session approvals lock the session before updating
requests to prevent conflicting lock order.

Keep approval outcomes available after decisions and reloads as compact,
neutral conversation rows. Details start collapsed. Expired rows state
that the action did not run; only pending requests show an attention
border and decision buttons. The server decides whether a request is
still live; a user's device clock cannot disable it. History includes
live requests and the 50 most recent outcomes. Polls read small status
records and refresh full history when statuses change.

The proxy still waits up to 180 seconds. This is a network wait, not
durable paused execution. Expired requests show Expired, and late
decisions return a conflict. Agent permission requests that cannot
resume fail scheduled runs with a clear reason. Losing an execution
lease aborts the agent.

The plugin editors and personal/task permission controls are in the
preceding PR, #16185. Approval queries remain in the existing Craft DB
module, as requested for this feature.

## How Has This Been Tested?

- Ten approval-card/history tests pass, including collapsed neutral
expiry, detail expansion, and live-request controls.
- A browser check confirmed the neutral expired row and unchanged
pending controls.
- 82 gate unit tests passed after restoring the Craft DB module.

- Earlier verification passed 21 approval API database tests, including
concurrent session grants, retries, conflicting decisions, history, and
expiry.
- Earlier local Kind checks covered concurrent grants, a browser clock
ten minutes ahead, and approved history after reload.
- A scheduled worker requested approval without an open browser;
approval resumed execution and produced the expected result.
- An actual 180-second timeout blocked forwarding and rejected a late
decision.
- Follow-up verification passed 39 approval/executor database tests, 550
proxy unit tests, and five route-contract tests.

## Additional Options

- [ ] [Optional] Please cherry-pick this PR to the latest release
version.
- [x] [Optional] Override Linear Check


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Approval cards now offer **Approve once**, **Approve for session**,
and **Reject** in one flow, with session-wide approval available when
eligible.
* Session approval history now shows pending, approved, rejected, and
expired requests. Status updates are checked automatically, and changed
statuses refresh the history.
* Cards show approval deadlines and present completed requests as
compact, expandable outcomes.

* **Bug Fixes**
* Scheduled runs that need unavailable permissions now finish as failed
runs instead of waiting for approval.
  * Expired approval messages clarify that the action did not run.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-19 18:44:15 +00:00
Wenxi e9c36400a7 feat(craft): enforce personal and task action policies (#16179)
## Description

Give each user and scheduled task its own action settings.
Workspace-disabled actions always remain blocked. Admins can require
workspace settings or let users choose their own settings.

Scheduled tasks now show app and MCP cards. Apps start disabled. When
creating a task, enabling an app copies the user's current settings.
Existing tasks keep their saved choices when apps are enabled again;
missing choices require approval. Later requests use the task's saved
settings and current workspace restrictions.

One migration replaces app-wide task pre-approvals with per-action
settings. Existing tasks receive auto-approval only for known actions in
apps they already pre-approved. Apps remain enabled even if they have no
known actions. New actions require approval. The migration remains with
the code that reads the new tables.

Action recognition identifies the request. One policy resolver then
applies workspace restrictions, task membership, personal or task
settings, and session grants. Failed recognition or policy lookup blocks
the request. A completed scheduled session cannot use personal settings
for later requests.

The next PR adds app settings editors. This PR includes the task editor
because its payload changes with the task API.

## How Has This Been Tested?

The complete stack passed 71 local Kind scenario checks, covering
browser editing, persistence, access restrictions, real proxy requests,
and scheduled execution. Checks include a real 180-second approval
timeout, live policy changes, and completed-task request rejection.

This PR’s intermediate tree passed 1,053 backend unit tests, 148
database tests, five route-contract tests, and 39 frontend tests. Python
and TypeScript checks and changed-file pre-commit checks passed.

No migration was applied to the user's database during this
verification.

## Additional Options

- [ ] [Optional] Please cherry-pick this PR to the latest release
version.
- [x] [Optional] Override Linear Check


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added per-action approval settings for connected apps and MCP tools,
with workspace, personal, and scheduled-task controls.
* Scheduled tasks can enable apps and configure individual actions when
creating or editing tasks; settings are also visible on task details.
New tasks start with apps disabled.
* Policy editors support searching, bulk changes, and resetting editable
choices.
* **Security & Permissions**
* Workspace restrictions remain binding, and task settings are checked
during active runs.
* Actions requiring approval still prompt users when app credentials are
unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-19 18:44:13 +00:00
Wenxi 5baaf19b0d refactor(craft): align action policy names (#16184) 2026-10-19 17:48:55 +00:00
Wenxi 362137d3eb refactor(backend): inline redundant forwarding helpers (#16155) 2026-10-16 18:33:10 +00:00
Wenxi 6955635f73 fix(craft): OpenCode cold startup and local development resource budgets (#15769) 2026-10-09 21:01:40 +00:00
Wenxi 939aa526f8 fix(craft): remove kindnet CPU throttling in local clusters (#15724) 2026-10-08 21:09:35 +00:00
Wenxi de3f09c7fd refactor(craft): organize sandbox proxy modules and models (#15561) 2026-10-08 19:13:49 +00:00
Wenxi b266a22e31 fix(craft): allow 90 seconds for OpenCode session initialization (#15715) 2026-10-08 18:17:20 +00:00
Wenxi 89c29f10ae refactor(craft): rename sandbox daemon contract module to models (#15687) 2026-10-07 23:38:59 +00:00
Wenxi 7512729af3 fix(dev): recover stale Telepresence agents during k8s launch (#15651) 2026-10-06 22:58:00 +00:00
Yuhong SunandClaude Opus 5.5 8ced9bc01f chore: remove Vespa and consolidate the document index interface (#15336)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 19:22:34 +00:00
Wenxi dd22ca103c chore(dev): improve local kind development and add Zed launcher (#14683) 2026-09-14 19:23:15 +00:00
WenxiandClaude Opus 5 5bf03a2c0f fix(craft-dev): unbreak fresh local kind setup (#14562)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 21:00:14 +00:00
Wenxi 439a6086ac chore: bump sandbox opencode to 1.18.19 (message-ID rollover fix) (#14130) 2026-08-20 21:24:26 +00:00
Wenxi d98a5d855d feat(scheduled-tasks): support MCP pre-approvals (#13884) 2026-08-12 19:08:05 +00:00
roshan f807785611 feat(craft): lazy webapp provisioning on setup and restore (#13712) 2026-08-07 18:42:13 +00:00
roshan b427760c3d feat(craft): add webapp bootstrap script generator and tool assets (#13711) 2026-08-05 00:51:01 +00:00
Wenxi 3da2048fb9 chore(craft): upgrade OpenCode to 1.18.13 (#13741) 2026-08-04 22:25:53 +00:00
Jamison LahmanandClaude Opus 5 73616a28de chore(install): make install.sh a bootstrap for onyx-cli deploy (#13615)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 21:36:08 +00:00
DanelegendandClaude Opus 5 bb5bbc2b40 feat(craft): pre-pull the sandbox image for docker-compose deployments (#13592)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 18:30:27 +00:00
DanelegendandClaude Opus 5 4ea5da046c fix(craft): drop the prepuller PriorityClass (#13562)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 17:34:48 +00:00
DanelegendandClaude Opus 5 9e055af760 feat(craft): pre-pull the sandbox image onto the sandbox node pool (#13490)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 06:46:18 +00:00
Wenxi 461dbb8c5d test(craft): move unit tests to discovered paths and prune trivial tests (#13523) 2026-07-28 22:57:41 +00:00
Jamison LahmanandClaude Opus 5 efc5695ad0 chore(deps-dev): bump ruff to 0.16.0 (#13479)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 20:49:05 +00:00
roshanandClaude Fable 5 2164093ae3 refactor: consolidate API routing on ONYX_SERVER_URL (#13375)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 23:13:18 +00:00
roshanandClaude Opus 4.8 1e7975e57c feat(craft): default ENABLE_BROWSER on to match the sandbox image (#12659)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 19:59:00 +00:00
roshanandClaude Opus 4.8 6b10c2c91c feat(craft): context-window usage ring + compaction marker (#12613)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 00:22:46 +00:00
Wenxi f08c2b43d8 docs: remove stale skills planning docs (#12638) 2026-07-01 23:29:36 +00:00
roshanandClaude Opus 4.8 5895337a05 feat(craft): give the agent headless browser use via a built-in browser skill (#12564)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 18:46:01 +00:00
Wenxi 537e2d93a2 chore(craft): clean up old plans and add egress proxy docs (#12485) 2026-06-26 21:15:31 +00:00
WenxiandClaude Opus 4.8 87f2e9670e chore(craft): real k8s integration tests (#12221)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 20:22:43 +00:00
Wenxi b947801f3a test(craft): expand Docker compose integration coverage (#12455) 2026-06-25 23:54:24 +00:00
Wenxi 29186289d0 docs(craft): align sandbox push documentation (#12456) 2026-06-25 23:41:05 +00:00
roshanandClaude Opus 4.8 4e3fe1670a feat(terraform): make Craft sandbox node group configurable and autoscaling-ready (#12399)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 22:54:31 +00:00
roshanandClaude Opus 4.8 62f14fd8f6 fix(craft): let celery-worker-heavy create sandbox snapshots (NetworkPolicy + push key) (#12173)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 01:13:10 +00:00
Wenxi 82654d4215 chore(craft): remove unused build code (#11959) 2026-06-17 23:49:05 +00:00
Wenxi e86db01e3e feat(craft): align sandbox image tagging with app releases (#12141) 2026-06-17 19:20:02 +00:00
roshanandClaude Opus 4.8 4940af0d56 feat(skills): add user-managed personal skills (#11923)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 05:01:32 +00:00
roshanandClaude Fable 5 ded7f41e48 refactor(craft): move sandbox celery tasks to background/celery/tasks/build (#12033)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-16 18:12:36 +00:00
roshanandClaude Fable 5 37f9b55ddb refactor(craft): reorganize build package into domain packages (#12032)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-16 17:27:55 +00:00
roshanandClaude Opus 4.8 faecc884b2 feat(craft): prune session snapshots on write (keep only the latest) (#12002)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 19:24:25 +00:00
Wenxi 4dca940093 fix(sandbox): update runtime toolchain (#11998) 2026-06-12 19:01:48 +00:00
Wenxi 3df10921df fix(craft): persist opencode chat history (#11922) 2026-06-12 01:25:55 +00:00
Wenxi 6bd2812558 build(craft): upgrade sandbox image to Python 3.13 (#11965) 2026-06-12 00:34:42 +00:00
Wenxi 297d475a33 feat(craft): migrate sandbox sidecar to restartable init container (#11928) 2026-06-11 17:28:35 +00:00
Wenxi b218be087d fix(craft): codify sandbox proxy IRSA wiring (#11926) 2026-06-11 01:19:36 +00:00
roshanandClaude Opus 4.8 58482669d6 feat(craft): codify sandbox pod spec into a Helm PodTemplate (#11919)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 01:05:40 +00:00
Wenxi 30f07fda92 refactor(craft): store snapshots in onyx filestore (#11909) 2026-06-10 20:43:31 +00:00
roshanandClaude Fable 5 74c4af264f ci(craft): deploy ad-hoc sandbox images via sandbox/dev git tags (#11893)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 17:28:26 +00:00
roshanandClaude Opus 4.8 a871ef9499 feat(craft): make Craft runtime-only; drop the craft backend image (#11877)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 01:45:39 +00:00