Skip to content

feat: bridge daemon POST /run for agentic code tasks (0194) - #159

Merged
crs48 merged 1 commit into
mainfrom
feat/agent-bridge-run-0194
Jun 17, 2026
Merged

feat: bridge daemon POST /run for agentic code tasks (0194)#159
crs48 merged 1 commit into
mainfrom
feat/agent-bridge-run-0194

Conversation

@crs48

@crs48 crs48 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What & why

Exploration 0194. Completes the bridge daemon's surface — health + chat + run — by wiring devkit's existing-but-unserved handleBridgeRun into the daemon as POST /run. This is the HTTP seam the in-app UI will call to trigger a gated agentic code task (the counterpart to xnet code, over the bridge).

Changes

  • @xnetjs/devkitcreateBridgeServer gains an optional run handler; POST /run validates {taskId, prompt, worktreeName?} and delegates (400 on missing fields, 501 when not enabled, 502 on throw). Decoupled from handleBridgeRun via the handler type, so it's tested with an injected fake — no git needed.
  • @xnetjs/clixnet bridge serve --code builds the run handler from handleBridgeRun over the repo at --cwd (Git + cliAgentRunner + defaultXnetGate + worktreeRoot).

Safe by default: /run runs a coding agent + the validation gate (arbitrary code execution), so it's opt-in — without --code the endpoint answers 501.

Tests / validation

  • devkit 54 (bridge-server 11: /run 501-disabled, delegate-to-handler, 400-missing-fields, 502-on-throw) + CLI 43, green.
  • typecheck (devkit + cli), eslint --max-warnings 0, prettier --check clean. No new deps.

Deferred

Electron /run (repo ambiguity in a packaged app); the in-app "create/edit plugin" button that calls POST /run; plus the earlier ACP transport / in-panel approval items.

🤖 Generated with Claude Code

Completes the bridge daemon's surface (health + chat + run). Wires devkit's
existing-but-unserved handleBridgeRun into the daemon as POST /run: isolate in a
worktree → coding agent edits → validation gate → checkpoint/rollback. Opt-in
and safe-by-default (it runs a coding agent + the gate = arbitrary code exec):
when no run handler is configured, /run answers 501.

@xnetjs/devkit:
- createBridgeServer gains an optional `run` handler; POST /run validates
  {taskId, prompt, worktreeName?} and delegates to it (400 on missing fields,
  502 on throw). Decoupled from handleBridgeRun via the handler type so it's
  tested with an injected fake (no git needed).

@xnetjs/cli:
- `xnet bridge serve --code` builds the run handler from handleBridgeRun over the
  repo at --cwd (Git + cliAgentRunner + defaultXnetGate + worktreeRoot).

This is the HTTP seam the in-app UI will call to trigger a gated code task.

Tests: devkit 54 (bridge-server 11: /run 501-disabled, delegate, 400, 502).
typecheck, eslint --max-warnings 0, prettier clean. Electron /run deferred
(repo ambiguity); in-app UI button deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@crs48
crs48 temporarily deployed to pr-159 June 17, 2026 20:54 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Preview removed for PR #159.

github-actions Bot added a commit that referenced this pull request Jun 17, 2026
@crs48
crs48 merged commit 3e47980 into main Jun 17, 2026
9 of 10 checks passed
@crs48
crs48 deleted the feat/agent-bridge-run-0194 branch June 17, 2026 21:16
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
crs48 added a commit that referenced this pull request Jun 18, 2026
…193/0194) (#201)

The `changelog-section` required check was only added in #164, so the
0192/0193/0194 feature batch merged before it never got changelog
entries. This backfills the 12 user-facing features that were missing,
each dated to its merge day with its PR number and contributors:

| PR | Entry |
|----|-------|
| #138 | A safer foundation for plugins |
| #145 | One trust model across plugins and Labs |
| #146 | Reliability you can see for managed hubs |
| #148 | Drive your own coding agent from xNet |
| #149 | AI that can act on your workspace |
| #150 | Your Labs become AI tools |
| #152 | Your agent can use your workspace |
| #154 | AI edits, right inside the editor |
| #155 | An agentic dev loop in your terminal |
| #158 | Review AI edits before they apply |
| #159 | Kick off agentic code tasks from xNet |
| #162 | Plugins run on the Labs runtime |

Skipped: PRs already covered by umbrella entries (#142 plugin ecosystem,
#144 extensibility fabric, #147 automated changelog, #163 agent panel,
#180 changelog gallery), internal-only changes (#139 schema authz — zero
user-facing effect), and meta/test/docs PRs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant