feat(agents): bulk edit agent runtime, model, concurrency, args, and env#3869
Open
646826 wants to merge 1 commit into
Open
feat(agents): bulk edit agent runtime, model, concurrency, args, and env#3869646826 wants to merge 1 commit into
646826 wants to merge 1 commit into
Conversation
|
Someone is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
646826
force-pushed
the
feat/agent-runtime-model
branch
from
June 7, 2026 23:25
2f0374d to
2da1c7a
Compare
646826
force-pushed
the
feat/agent-runtime-model
branch
3 times, most recently
from
June 16, 2026 02:26
757a835 to
3f17d16
Compare
Add a Bulk edit dialog so workspace owners/admins can update shared launch settings across selected agents or every active agent in a workspace — runtime, model, max concurrent tasks, custom CLI args, and environment variable keys — with each field opt-in (disabled fields are left unchanged). Single-agent and bulk "clear model" both persist SQL NULL, falling back to the runtime/CLI default. Changing runtime/model only affects new tasks; Multica keeps no workspace-level active engine. DB / API / server: - agent.sql + generated: ListAgentsForUpdate, ListAgentsByIDsForUpdate (write), ListAgentsByIDs (read, non-locking — no per-agent N+1), ClearAgentModel. - handler: BulkUpdateAgents + ListBulkAgentEnvKeys (owner/admin only, agent actor rejected 403, one transaction across all targets, env-change audit by key name only). Env values are never returned, logged, or surfaced — only key names and counts. patchAgentEnv preserves a value via a sentinel without reading it. Core: - typed API client (parseWithFallback + zod, typed EMPTY_* fallbacks) and a local presets store via StorageAdapter (env values never persisted). UI: - bulk-edit dialog + agents-page entry points; affected-count banner uses the semantic warning token; all copy via i18n in en/ja/ko/zh-Hans. Docs: - agents-runtime-model.mdx + nav. Tests: - handler coverage (selected/all, clear-model->NULL, archived rejection, UUID dedup, agent-actor 403, env keys-only / no value leak), core/views vitest, e2e/agents-bulk-edit.spec.ts. Shared e2e infra hardened for per-worker isolation and onboarding-v2.
646826
force-pushed
the
feat/agent-runtime-model
branch
from
June 16, 2026 09:20
3f17d16 to
0b6099e
Compare
Contributor
Author
|
Rebased onto the latest
29 files, single commit, 0 conflicts against the new base. All CI checks green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds Bulk edit agents so workspace owners/admins can update shared launch
settings across selected agents or every active agent in a workspace,
instead of editing agents one at a time.
Each field is opt-in — disabled fields are left unchanged, so you can update
only the model, only CLI args, only env keys, or any combination:
It also normalizes single-agent clear model to persist SQL
NULL(theCOALESCE-basedUpdateAgentcould only write""), so single-agent and bulkclear now mean the same thing: fall back to the runtime/CLI default.
Approach note: Multica has no workspace-level active engine — each agent
points to a runtime and the runtime's provider is used for new tasks. This PR
matches that model (no new global-engine concept); changing runtime/model only
affects new tasks.
Related Issue
No tracked issue — this is operator efficiency for bulk agent launch-config.
Adjacent to #3035 (declarative bulk import of agents/skills/squads), which this
PR does not implement; this is interactive bulk-edit of existing agents.
Type of Change
Changes Made
DB / API / server
server/pkg/db/queries/agent.sql(+ generatedagent.sql.go):ListAgentsForUpdate(all active,FOR UPDATE),ListAgentsByIDsForUpdate(selected,FOR UPDATE— write path),ListAgentsByIDs(selected, non-locking — read path),ClearAgentModel(explicitmodel = NULL).server/internal/handler/agent.go:BulkUpdateAgents+ListBulkAgentEnvKeys;UpdateAgenttreats empty model as NULL-clear; input normalization (normalizeBulkEnvPatch,normalizeBulkCustomArgsPatch,parseBulkAgentIDs); one transaction across all targets; per-agent env-change activity audit recording key names only. Both read and write target resolution use a single batched query (no per-agent N+1).server/internal/handler/agent_env.go:patchAgentEnv— set/replace/remove with a sentinel that preserves an existing value without reading it.server/cmd/server/router.go:POST /agents/bulk-update,POST /agents/env-keys(workspace owner/admin scope; agent actor rejected 403).Core (logic / types / API client)
packages/core/types/agent.ts(Bulk*types, re-exported from the barrel),api/client.ts(bulkUpdateAgents,listBulkAgentEnvKeys—parseWithFallback+ zod, no bare casts),api/schemas.ts(typedEMPTY_*fallbacks),agents/stores/bulk-edit-presets-store.ts(local presets viaStorageAdapter; env values never persisted).UI (views)
bulk-edit-agents-dialog.tsx(the dialog),tabs/custom-args-tab.tsx(+custom-args.ts). Integrated into main's current agents list grid (feat(lists): rebuild all six list surfaces on a shared Linear-style list grid #4038): a "Bulk edit selected" action in the selection bar (AgentBatchToolbar) and a "Bulk edit agents" (all active, admin-only) action in the page header (PageHeaderBar), both openingBulkEditAgentsDialogrendered at the page level. Affected-count banner uses the semanticwarningtoken (no hardcoded colors); all copy viat().bulk_edit.*) added toen,ja,ko,zh-Hans(provider rendered as 提供方/제공자 per the i18n glossary).Docs
apps/docs/content/docs/agents-runtime-model.mdx("Bulk edit agents") +meta.jsonnav + a cross-link line inagents-create.mdx.Tests
server/internal/handler/agent_test.go— selected/all field updates, clear-model→NULL (single + bulk), archived rejection (incl. archived-before-tx race), UUID dedup, agent-actor 403 on both bulk endpoints, env summary keys-only / no value leak, sentinel preserve.config_test.go— env isolation.packages/core+packages/viewsvitest — API client (incl. malformed-response fallback), preset store (env values not persisted),bulk-edit-agents-dialog.test.tsxdialog flows incl. the clear-model path,custom-args-tab.test.tsx.e2e/byte-identical tomain. (The oldagents-bulk-edit.spec.tswas written against the pre-feat(lists): rebuild all six list surfaces on a shared Linear-style list grid #4038<table>UI; main's new grid uses unlabeled hover-revealed checkboxes with no selectable agent name, so the spec was removed rather than rewritten with fragile position selectors — the bulk-edit behavior is covered by the dialog + handler unit tests above. A fresh e2e against the new grid is a follow-up.)How to Test
UI flow:
Checklist
agents-runtime-model.mdx+meta.jsonnav)apps/docs/content/docs/agents-runtime-model.mdx); no landing-page feature added, soapps/web/features/landing/i18n/is N/Adevelopers/conventions(provider → 提供方;taskstays lowercase English; full-width punctuation)Out of scope
feat/runtime-policy-failover-rotation).Risks (bounded review notes)
archived_at. All mutations run in one transaction; an env-audit write failure rolls the whole update back.owner/adminand reject anagentactor (403) — tested.ListBulkAgentEnvKeysreturns{key, agent_count}only; the activity log records key names; agent read responses carry only an env count. Negative tests assert the value is absent.e2e/changes (identical tomain), confined to the bulk-edit feature + its UI integration into the current agents grid.AI Disclosure
AI tool used: Claude Code (Opus) and Codex (GPT-5).
Prompt / approach: Spec-driven from a written production goal; TDD per fix (failing test → minimal fix → targeted + full gate); adversarial correctness/security audit plus a cross-check against the repo's own historical reviewer comments; fresh full verification before handoff. No
Co-authored-by/AI attribution in commit messages.Verification
Rebased onto current
origin/main(0 behind, single commit, 29 files). All GitHub CI checks green on the head commit:frontend(turbo build typecheck lint test)backend(go build · migrate up ·go test ./...)mobile(runs becausepackages/core/**changes)installer(macos-latest / ubuntu-latest)Locally (CI-exact commands): frontend gate green (views 1388, core 546, web 49, desktop 198 + build/typecheck/lint);
go test ./...29 pkgs, 0 FAIL on a fresh DB; reserved-slugs no drift; selfhost/install pass.Rebase note: main's #4038 rebuilt the agents list into a shared list grid (deleting
agent-columns.tsx); the bulk-edit UI was re-integrated into the new grid's selection bar + page header (see Changes Made). Localebulk_editkeys were merged into the current files;e2e/left identical to main.Screenshots
UI screenshots of the Bulk edit flow (attached below). The dialog screenshots (
03/04) are current — the dialog is unchanged. The page-context shots (01/02/05) were captured before the rebase and show the previous agents table rather than main's new list grid; the trigger placement is current ("Bulk edit selected" in the selection bar, "Bulk edit agents" in the header), and refreshed page screenshots against the new grid are a quick follow-up.01-agents-page.png02-agents-selected.png03-dialog-empty.png04-dialog-filled.pnggpt-5.5, Custom argsAdd --max-turns 100(+ existing-args picker), EnvSet/replace BULK_E2E_KEY(+ existing-keys picker), affected-count banner (warning token), Apply05-dialog-all-active.png