An open-source, faster Devin alternative
TypeScript
refactor(flue): narrow config to the preview path
Igor Zalutski8a84945d8f01
diff --git a/cloudflare-workers/oc-gateway/scripts/mint.ts b/cloudflare-workers/oc-gateway/scripts/mint.tsindex aa2ebc44..21437f61 100644--- a/cloudflare-workers/oc-gateway/scripts/mint.ts+++ b/cloudflare-workers/oc-gateway/scripts/mint.ts@@ -48,7 +48,6 @@ const claims: DeployClaims = {org: arg("org", "org_1")!,agt: arg("agent", "agt_1")!,ep: ep != null ? Number(ep) : undefined,- scopes: ["gateway:invoke", "sandbox:use", "repo:use", "ingest:write"],iat: now,exp: now + ttl,};diff --git a/cloudflare-workers/oc-gateway/src/index.ts b/cloudflare-workers/oc-gateway/src/index.tsindex 9138e746..daa8b8f9 100644--- a/cloudflare-workers/oc-gateway/src/index.ts+++ b/cloudflare-workers/oc-gateway/src/index.ts@@ -118,7 +118,7 @@ export default {const token = bearer(req.headers);if (!token) return json({ error: { type: "unauthorized", message: "missing deploy token" } }, 401);const nowSec = Math.floor(Date.now() / 1000);- const v = await verifyDeployToken(env.GATEWAY_TOKEN_PUBLIC_KEY, token, nowSec, "gateway:invoke");+ const v = await verifyDeployToken(env.GATEWAY_TOKEN_PUBLIC_KEY, token, nowSec);if (!v.ok) return json({ error: { type: "unauthorized", message: `invalid deploy token: ${v.reason}` } }, 401);const { org: orgId, agt: agentId, ep } = v.claims;diff --git a/cloudflare-workers/oc-gateway/src/token.ts b/cloudflare-workers/oc-gateway/src/token.tsindex e47d11a8..6be8a1d7 100644--- a/cloudflare-workers/oc-gateway/src/token.ts+++ b/cloudflare-workers/oc-gateway/src/token.ts@@ -17,7 +17,7 @@// explicitly-revoked deploy token stops verifying even before `exp`.//// MINT↔VERIFY CONTRACT (W7 mints; the gateway verifies):-// alg "EdDSA"; claims { org, agt, iat, exp, ep?, scopes[] }; the gateway is configured with+// alg "EdDSA"; claims { org, agt, iat, exp, ep? }; the gateway is configured with// GATEWAY_TOKEN_PUBLIC_KEY = base64url(raw 32-byte Ed25519 public key).export interface DeployClaims {@@ -27,8 +27,6 @@ export interface DeployClaims {agt: string;/** lease/deploy epoch (monotonic per (org, agt)). Below the DeployLease floor → fenced. Omit = no fence. */ep?: number;- /** Explicit tenant capabilities; the gateway requires `gateway:invoke`. */- scopes: Array<"gateway:invoke" | "sandbox:use" | "repo:use" | "ingest:write">;/** issued-at / expiry (seconds). */iat: number;exp: number;@@ -59,12 +57,7 @@ async function importPublicKey(publicKeyB64url: string): Promise<CryptoKey> {export type VerifyResult = { ok: true; claims: DeployClaims } | { ok: false; reason: string };/** Verify a per-deploy EdDSA token: alg pin + signature + exp/iat + required claims (org, agt). */-export async function verifyDeployToken(- publicKeyB64url: string,- token: string,- nowSec: number,- requiredScope?: DeployClaims["scopes"][number],-): Promise<VerifyResult> {+export async function verifyDeployToken(publicKeyB64url: string, token: string, nowSec: number): Promise<VerifyResult> {const parts = token.split(".");if (parts.length !== 3) return { ok: false, reason: "malformed" };const [header, payload, sig] = parts;@@ -101,14 +94,9 @@ export async function verifyDeployToken(if (typeof claims.exp !== "number" || claims.exp <= nowSec) return { ok: false, reason: "expired" };if (typeof claims.iat === "number" && claims.iat > nowSec + 60) return { ok: false, reason: "future_iat" };if (!claims.org || !claims.agt) return { ok: false, reason: "missing_claims" };- if (!Array.isArray(claims.scopes) || claims.scopes.some((scope) =>- scope !== "gateway:invoke" && scope !== "sandbox:use" && scope !== "repo:use" && scope !== "ingest:write")) {- return { ok: false, reason: "bad_scopes" };- }if (claims.ep !== undefined && (!Number.isSafeInteger(claims.ep) || claims.ep < 0)) {return { ok: false, reason: "bad_epoch" };}- if (requiredScope && !claims.scopes.includes(requiredScope)) return { ok: false, reason: "missing_scope" };return { ok: true, claims };}diff --git a/cloudflare-workers/oc-gateway/test/integration.test.ts b/cloudflare-workers/oc-gateway/test/integration.test.tsindex 49cf79f7..1ce24ed8 100644--- a/cloudflare-workers/oc-gateway/test/integration.test.ts+++ b/cloudflare-workers/oc-gateway/test/integration.test.ts@@ -10,7 +10,7 @@ import { describe, it, expect, beforeEach, beforeAll, vi, afterEach } from "viteimport worker, { Env } from "../src/index.js";import { SpendCounter } from "../src/budget.js";import { DeployLease } from "../src/deploylease.js";-import { generateKeyPair, mintDeployToken, type DeployClaims } from "../src/token.js";+import { generateKeyPair, mintDeployToken } from "../src/token.js";const OR_KEY = "sk-or-v1-FAKE-org-key";const OR_BASE = "https://mock-openrouter.test/api";@@ -89,9 +89,9 @@ const post = (token?: string, session?: string, body = MSG) => new Request("http},body,});-const mint = async (o: Partial<{ org: string; agt: string; ep: number; scopes: DeployClaims["scopes"]; iat: number; exp: number }> = {}) => {+const mint = async (o: Partial<{ org: string; agt: string; ep: number; iat: number; exp: number }> = {}) => {const now = Math.floor(Date.now() / 1000);- return mintDeployToken(PRIV, { org: "org_1", agt: "agt_1", scopes: ["gateway:invoke"], iat: now, exp: now + 3600, ...o });+ return mintDeployToken(PRIV, { org: "org_1", agt: "agt_1", iat: now, exp: now + 3600, ...o });};const stateOf = async (inst: { fetch(r: Request): Promise<Response> }) =>(await inst.fetch(new Request("https://do/state"))).json() as Promise<{ spent_micro: number }>;diff --git a/cloudflare-workers/oc-gateway/test/logic.test.ts b/cloudflare-workers/oc-gateway/test/logic.test.tsindex c1b1ae37..c14049e2 100644--- a/cloudflare-workers/oc-gateway/test/logic.test.ts+++ b/cloudflare-workers/oc-gateway/test/logic.test.ts@@ -13,7 +13,7 @@ import { DeployLease } from "../src/deploylease.js";const now = 1_800_000_000;const b64url = (o: unknown) => btoa(JSON.stringify(o)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");const claims = (o: Partial<DeployClaims> = {}): DeployClaims => ({- org: "org_1", agt: "agt_1", ep: 2, scopes: ["gateway:invoke", "sandbox:use"], iat: now, exp: now + 3600, ...o,+ org: "org_1", agt: "agt_1", ep: 2, iat: now, exp: now + 3600, ...o,});function fakeState(): DurableObjectState {@@ -58,18 +58,11 @@ describe("deploy token (EdDSA, per-deploy {org, agt})", () => {});it("rejects a token missing org/agt", async () => {const { privateKey, publicKeyB64url } = await generateKeyPair();- const t = await mintDeployToken(privateKey, { org: "", agt: "", scopes: ["gateway:invoke"], iat: now, exp: now + 3600 });+ const t = await mintDeployToken(privateKey, { org: "", agt: "", iat: now, exp: now + 3600 });const v = await verifyDeployToken(publicKeyB64url, t, now);expect(v.ok).toBe(false);if (!v.ok) expect(v.reason).toBe("missing_claims");});- it("requires the named capability", async () => {- const { privateKey, publicKeyB64url } = await generateKeyPair();- const token = await mintDeployToken(privateKey, claims({ scopes: ["sandbox:use"] }));- const v = await verifyDeployToken(publicKeyB64url, token, now, "gateway:invoke");- expect(v.ok).toBe(false);- if (!v.ok) expect(v.reason).toBe("missing_scope");- });it("pins alg=EdDSA — rejects an alg-swap (none/HS256) header", async () => {const { privateKey, publicKeyB64url } = await generateKeyPair();const [, p, s] = (await mintDeployToken(privateKey, claims())).split(".");diff --git a/cmd/oc/internal/commands/agent_config.go b/cmd/oc/internal/commands/agent_config.goindex 56f7910e..2260a217 100644--- a/cmd/oc/internal/commands/agent_config.go+++ b/cmd/oc/internal/commands/agent_config.go@@ -1,14 +1,13 @@package commands-// Flue Worker configuration. Non-secret vars can also live in agent.toml's-// [vars] section; secret values are accepted only by the write-only secret API.+// Preview Flue configuration has one source of truth: non-secret vars come from agent.toml and+// write-only secrets come from this command. Both are applied by the next explicit agent deploy.import (- "bufio""fmt"+ "io""net/url""os"- "sort""strings""github.com/opensandbox/opensandbox/cmd/oc/internal/client"@@ -17,15 +16,14 @@ import (type agentConfig struct {Vars map[string]string `json:"vars"`- EgressAllowlist []string `json:"egress_allowlist"`DeploymentRequired bool `json:"deployment_required,omitempty"`}type agentSecret struct {- Name string `json:"name"`- Last4 string `json:"last4"`- UpdatedAt string `json:"updated_at"`- SyncStatus string `json:"sync_status"`+ Name string `json:"name"`+ Last4 string `json:"last4"`+ UpdatedAt string `json:"updated_at"`+ DeploymentRequired bool `json:"deployment_required,omitempty"`}type agentSecretList struct {@@ -38,179 +36,36 @@ func agentSecretPath(id, name string) string {return agentSecretsPath(id) + "/" + url.PathEscape(name)}-func getAgentConfig(cmd *cobra.Command, sc *client.Client, id string) (agentConfig, error) {- var cfg agentConfig- err := sc.Get(cmd.Context(), agentConfigPath(id), &cfg)- if cfg.Vars == nil {- cfg.Vars = map[string]string{}- }- return cfg, err-}--func putAgentConfig(cmd *cobra.Command, sc *client.Client, id string, cfg agentConfig) (agentConfig, error) {- var saved agentConfig- err := sc.PutJSON(cmd.Context(), agentConfigPath(id), map[string]interface{}{- "vars": cfg.Vars, "egress_allowlist": cfg.EgressAllowlist,- }, &saved)- return saved, err-}--// syncManifestVars applies [vars] before a Flue deployment is enqueued. A nil-// Vars map means no section was supplied, so an ordinary deploy never erases-// config that was managed through the API/dashboard.+// syncManifestVars makes agent.toml the only non-secret config source. An absent [vars] section is+// an empty desired map, so deleting the section and deploying removes prior bindings.func syncManifestVars(cmd *cobra.Command, sc *client.Client, id string, m *manifest) error {- if m.Vars == nil {- return nil+ vars := m.Vars+ if vars == nil {+ vars = map[string]string{}}- cfg, err := getAgentConfig(cmd, sc, id)- if err != nil {- return fmt.Errorf("read agent config: %w", err)- }- cfg.Vars = m.Vars- if _, err := putAgentConfig(cmd, sc, id, cfg); err != nil {+ var saved agentConfig+ if err := sc.PutJSON(cmd.Context(), agentConfigPath(id), map[string]interface{}{"vars": vars}, &saved); err != nil {return fmt.Errorf("sync agent.toml [vars]: %w", err)}return nil}-func parseConfigVars(values []string) (map[string]string, error) {- out := make(map[string]string, len(values))- for _, raw := range values {- name, value, ok := strings.Cut(raw, "=")- name = strings.TrimSpace(name)- if !ok || name == "" {- return nil, fmt.Errorf("invalid --var %q (want NAME=VALUE)", raw)- }- out[name] = value- }- return out, nil-}--func sortedUnique(values []string) []string {- seen := make(map[string]struct{}, len(values))- for _, value := range values {- value = strings.TrimSpace(value)- if value != "" {- seen[value] = struct{}{}- }- }- out := make([]string, 0, len(seen))- for value := range seen {- out = append(out, value)- }- sort.Strings(out)- return out-}--var agentConfigCmd = &cobra.Command{- Use: "config [id|name]",- Short: "Show or update a Flue agent's vars and outbound host allowlist",- Long: "Show a Flue agent's Worker configuration. Update it with --var, --unset-var,\n" +- "--allow-host, or --deny-host. Vars take effect on the next deploy; secrets use\n" +- "`oc agent secret` and never appear here.",- Args: cobra.MaximumNArgs(1),- RunE: func(cmd *cobra.Command, args []string) error {- sc, err := sessionsClient(cmd)- if err != nil {- return err- }- id, err := targetAgentID(cmd, sc, args)- if err != nil {- return err- }- cfg, err := getAgentConfig(cmd, sc, id)- if err != nil {- return err- }-- setVars, _ := cmd.Flags().GetStringArray("var")- unsetVars, _ := cmd.Flags().GetStringArray("unset-var")- allowHosts, _ := cmd.Flags().GetStringArray("allow-host")- denyHosts, _ := cmd.Flags().GetStringArray("deny-host")- clearVars, _ := cmd.Flags().GetBool("clear-vars")- clearEgress, _ := cmd.Flags().GetBool("clear-egress")- changing := len(setVars)+len(unsetVars)+len(allowHosts)+len(denyHosts) > 0 || clearVars || clearEgress- if changing {- parsed, err := parseConfigVars(setVars)- if err != nil {- return err- }- if clearVars {- cfg.Vars = map[string]string{}- }- for name, value := range parsed {- cfg.Vars[name] = value- }- for _, name := range unsetVars {- delete(cfg.Vars, strings.TrimSpace(name))- }- if clearEgress {- cfg.EgressAllowlist = nil- }- cfg.EgressAllowlist = append(cfg.EgressAllowlist, allowHosts...)- denied := make(map[string]struct{}, len(denyHosts))- for _, host := range denyHosts {- denied[strings.TrimSpace(host)] = struct{}{}- }- hosts := cfg.EgressAllowlist[:0]- for _, host := range sortedUnique(cfg.EgressAllowlist) {- if _, remove := denied[host]; !remove {- hosts = append(hosts, host)- }- }- cfg.EgressAllowlist = hosts- cfg, err = putAgentConfig(cmd, sc, id, cfg)- if err != nil {- return err- }- }-- printer.Print(cfg, func() {- if len(cfg.Vars) == 0 {- fmt.Println("Vars: (none)")- } else {- fmt.Println("Vars:")- keys := make([]string, 0, len(cfg.Vars))- for key := range cfg.Vars {- keys = append(keys, key)- }- sort.Strings(keys)- for _, key := range keys {- fmt.Printf(" %s=%s\n", key, cfg.Vars[key])- }- }- if len(cfg.EgressAllowlist) == 0 {- fmt.Println("Outbound hosts: (none; fail-closed)")- } else {- fmt.Println("Outbound hosts:")- for _, host := range cfg.EgressAllowlist {- fmt.Printf(" %s\n", host)- }- }- if changing {- fmt.Println("Saved. Vars apply on the next deploy; egress policy applies shortly.")- }- })- return nil- },-}-var agentSecretCmd = &cobra.Command{Use: "secret",- Short: "Manage write-only Flue Worker secrets",+ Short: "Manage write-only Flue Worker secrets for the next deploy",}var agentSecretListCmd = &cobra.Command{- Use: "list [id|name]",+ Use: "list",Aliases: []string{"ls"},Short: "List secret metadata (values are never returned)",- Args: cobra.MaximumNArgs(1),- RunE: func(cmd *cobra.Command, args []string) error {+ Args: cobra.NoArgs,+ RunE: func(cmd *cobra.Command, _ []string) error {sc, err := sessionsClient(cmd)if err != nil {return err}- id, err := targetAgentID(cmd, sc, args)+ id, err := targetAgentID(cmd, sc, nil)if err != nil {return err}@@ -225,21 +80,32 @@ var agentSecretListCmd = &cobra.Command{}rows := make([][]string, 0, len(res.Data))for _, secret := range res.Data {- rows = append(rows, []string{secret.Name, secret.Last4, secret.SyncStatus, formatAge(secret.UpdatedAt)})+ rows = append(rows, []string{secret.Name, secret.Last4, formatAge(secret.UpdatedAt)})}- printer.Table([]string{"NAME", "LAST4", "STATUS", "UPDATED"}, rows)+ printer.Table([]string{"NAME", "LAST4", "UPDATED"}, rows)})return nil},}var agentSecretSetCmd = &cobra.Command{- Use: "set <name> [value]",- Short: "Set or rotate a Worker secret",- Long: "Set a write-only Flue Worker secret. Prefer --from-stdin so the value does not\n" +- "enter shell history. The live Worker is updated in place when already deployed.",- Args: cobra.RangeArgs(1, 2),+ Use: "set <name> --from-stdin",+ Short: "Save or rotate a Worker secret for the next deploy",+ Args: cobra.ExactArgs(1),RunE: func(cmd *cobra.Command, args []string) error {+ fromStdin, _ := cmd.Flags().GetBool("from-stdin")+ if !fromStdin {+ return fmt.Errorf("secret values are accepted only via --from-stdin")+ }+ raw, err := io.ReadAll(os.Stdin)+ if err != nil {+ return fmt.Errorf("reading stdin: %w", err)+ }+ value := strings.TrimSuffix(strings.TrimSuffix(string(raw), "\n"), "\r")+ if value == "" {+ return fmt.Errorf("secret value cannot be empty")+ }+sc, err := sessionsClient(cmd)if err != nil {return err@@ -248,34 +114,13 @@ var agentSecretSetCmd = &cobra.Command{if err != nil {return err}- fromStdin, _ := cmd.Flags().GetBool("from-stdin")- var value string- switch {- case fromStdin && len(args) == 2:- return fmt.Errorf("pass the value or --from-stdin, not both")- case fromStdin:- scanner := bufio.NewScanner(os.Stdin)- var lines []string- for scanner.Scan() {- lines = append(lines, scanner.Text())- }- if err := scanner.Err(); err != nil {- return fmt.Errorf("reading stdin: %w", err)- }- value = strings.Join(lines, "\n")- case len(args) == 2:- value = args[1]- default:- return fmt.Errorf("provide a value or use --from-stdin")- }- if value == "" {- return fmt.Errorf("secret value cannot be empty")- }var saved agentSecretif err := sc.PutJSON(cmd.Context(), agentSecretPath(id, args[0]), map[string]string{"value": value}, &saved); err != nil {return err}- printer.Print(saved, func() { fmt.Printf("Secret %s set (%s).\n", saved.Name, saved.SyncStatus) })+ printer.Print(saved, func() {+ fmt.Printf("Secret %s saved. Run `oc agent deploy` to apply it.\n", saved.Name)+ })return nil},}@@ -283,7 +128,7 @@ var agentSecretSetCmd = &cobra.Command{var agentSecretDeleteCmd = &cobra.Command{Use: "delete <name>",Aliases: []string{"rm"},- Short: "Delete a Worker secret",+ Short: "Remove a Worker secret on the next deploy",Args: cobra.ExactArgs(1),RunE: func(cmd *cobra.Command, args []string) error {sc, err := sessionsClient(cmd)@@ -297,24 +142,16 @@ var agentSecretDeleteCmd = &cobra.Command{if err := sc.Delete(cmd.Context(), agentSecretPath(id, args[0])); err != nil {return err}- fmt.Printf("Secret %s deleted.\n", args[0])+ fmt.Printf("Secret %s removed. Run `oc agent deploy` to apply it.\n", args[0])return nil},}func registerAgentConfig() {- agentConfigCmd.Flags().String("agent", "", "Target agent id or name (else the cwd agent.toml)")- agentConfigCmd.Flags().StringArray("var", nil, "Set a non-secret binding (NAME=VALUE; repeatable)")- agentConfigCmd.Flags().StringArray("unset-var", nil, "Remove a non-secret binding (repeatable)")- agentConfigCmd.Flags().StringArray("allow-host", nil, "Allow outbound HTTPS to a hostname (repeatable; supports *.example.com)")- agentConfigCmd.Flags().StringArray("deny-host", nil, "Remove a hostname from the outbound allowlist (repeatable)")- agentConfigCmd.Flags().Bool("clear-vars", false, "Remove all non-secret bindings")- agentConfigCmd.Flags().Bool("clear-egress", false, "Return outbound HTTPS to fail-closed defaults")-for _, command := range []*cobra.Command{agentSecretListCmd, agentSecretSetCmd, agentSecretDeleteCmd} {command.Flags().String("agent", "", "Target agent id or name (else the cwd agent.toml)")}agentSecretSetCmd.Flags().Bool("from-stdin", false, "Read the secret value from stdin")agentSecretCmd.AddCommand(agentSecretListCmd, agentSecretSetCmd, agentSecretDeleteCmd)- agentCmd.AddCommand(agentConfigCmd, agentSecretCmd)+ agentCmd.AddCommand(agentSecretCmd)}diff --git a/cmd/oc/internal/commands/agent_config_test.go b/cmd/oc/internal/commands/agent_config_test.gonew file mode 100644index 00000000..8243ad34--- /dev/null+++ b/cmd/oc/internal/commands/agent_config_test.go@@ -0,0 +1,22 @@+package commands++import (+ "strings"+ "testing"+)++func TestAgentSecretSetRejectsPositionalValue(t *testing.T) {+ if err := agentSecretSetCmd.Args(agentSecretSetCmd, []string{"TOKEN", "secret-value"}); err == nil {+ t.Fatal("expected a positional secret value to be rejected")+ }+}++func TestAgentSecretSetRequiresStdinFlag(t *testing.T) {+ if err := agentSecretSetCmd.Flags().Set("from-stdin", "false"); err != nil {+ t.Fatal(err)+ }+ err := agentSecretSetCmd.RunE(agentSecretSetCmd, []string{"TOKEN"})+ if err == nil || !strings.Contains(err.Error(), "--from-stdin") {+ t.Fatalf("error = %v, want --from-stdin requirement", err)+ }+}diff --git a/cmd/oc/internal/commands/agent_deploy.go b/cmd/oc/internal/commands/agent_deploy.goindex e45140ec..d909e7dc 100644--- a/cmd/oc/internal/commands/agent_deploy.go+++ b/cmd/oc/internal/commands/agent_deploy.go@@ -18,9 +18,8 @@ import (type manifest struct {Name string `toml:"name"`Model string `toml:"model"`- // Non-secret Flue Worker bindings. A nil map means the [vars] section was- // omitted and deploy must leave the remote config untouched; an explicitly- // empty [vars] section clears it. Secrets never belong in agent.toml.+ // Non-secret Flue Worker bindings. The manifest is authoritative: omitting+ // [vars] clears prior values on deploy. Secrets never belong in agent.toml.Vars map[string]string `toml:"vars"`Runtime struct {Family string `toml:"family"`diff --git a/cmd/oc/internal/commands/agent_deploy_flue.go b/cmd/oc/internal/commands/agent_deploy_flue.goindex 63957f4c..d0f26d16 100644--- a/cmd/oc/internal/commands/agent_deploy_flue.go+++ b/cmd/oc/internal/commands/agent_deploy_flue.go@@ -73,8 +73,8 @@ func deployFlue(cmd *cobra.Command, sc *client.Client, dir string, m *manifest,}// [vars] is part of the deployment input even though the values live in the// agent config resource. Persist it before enqueueing so the off-host runner- // cannot race ahead and compose the Worker with stale bindings. Preserve the- // separately managed egress allowlist. Secrets are intentionally CLI/API only.+ // cannot race ahead and compose the Worker with stale bindings. Secrets are+ // intentionally CLI/API only and are resolved by that same runner.if err := syncManifestVars(cmd, sc, id, m); err != nil {return err}diff --git a/cmd/oc/internal/commands/agent_deploy_flue_test.go b/cmd/oc/internal/commands/agent_deploy_flue_test.goindex 29a749bb..cdf56625 100644--- a/cmd/oc/internal/commands/agent_deploy_flue_test.go+++ b/cmd/oc/internal/commands/agent_deploy_flue_test.go@@ -43,7 +43,6 @@ type fakeCP struct {mu sync.Mutexself stringcreateBody map[string]any- configGets intconfigPutBody map[string]anyartifactDigest stringartifactSize float64@@ -65,14 +64,10 @@ func (f *fakeCP) ServeHTTP(w http.ResponseWriter, r *http.Request) {case r.Method == "POST" && r.URL.Path == "/v3/agents":_ = json.NewDecoder(r.Body).Decode(&f.createBody)writeJSON(map[string]any{"id": "agt_e2e", "name": "e2e-flue", "model": "anthropic/claude-sonnet-5", "runtime": "flue"})- case r.Method == "GET" && r.URL.Path == "/v3/agents/agt_e2e/config":- f.configGets++- writeJSON(map[string]any{"vars": map[string]string{}, "egress_allowlist": []string{"api.example.com"}})case r.Method == "PUT" && r.URL.Path == "/v3/agents/agt_e2e/config":_ = json.NewDecoder(r.Body).Decode(&f.configPutBody)writeJSON(map[string]any{- "vars": f.configPutBody["vars"], "egress_allowlist": f.configPutBody["egress_allowlist"],- "deployment_required": true,+ "vars": f.configPutBody["vars"], "deployment_required": true,})case r.Method == "POST" && r.URL.Path == "/v3/agents/agt_e2e/artifacts":var body map[string]any@@ -226,12 +221,12 @@ func TestDeployFlueDoEndToEnd(t *testing.T) {if f.getCount < 2 {t.Errorf("expected the poll to observe verifying→ready (got %d GETs)", f.getCount)}- if f.configGets != 0 || f.configPutBody != nil {- t.Errorf("manifest without [vars] unexpectedly touched remote config: gets=%d put=%v", f.configGets, f.configPutBody)+ if vars, ok := f.configPutBody["vars"].(map[string]any); !ok || len(vars) != 0 {+ t.Errorf("manifest without [vars] should clear desired vars, got %#v", f.configPutBody)}}-func TestSyncManifestVarsPreservesEgress(t *testing.T) {+func TestSyncManifestVarsReplacesDesiredVars(t *testing.T) {f := &fakeCP{}srv := httptest.NewServer(f)defer srv.Close()@@ -244,30 +239,10 @@ func TestSyncManifestVarsPreservesEgress(t *testing.T) {if err := syncManifestVars(cmd, sc, "agt_e2e", m); err != nil {t.Fatalf("syncManifestVars: %v", err)}- if f.configGets != 1 {- t.Fatalf("config GETs = %d, want 1", f.configGets)- }vars, _ := f.configPutBody["vars"].(map[string]any)if vars["PUBLIC_MODE"] != "careful" || vars["MAX_ITEMS"] != "12" {t.Errorf("vars PUT = %#v", f.configPutBody["vars"])}- hosts, _ := f.configPutBody["egress_allowlist"].([]any)- if len(hosts) != 1 || hosts[0] != "api.example.com" {- t.Errorf("egress allowlist was not preserved: %#v", f.configPutBody["egress_allowlist"])- }-}--func TestParseConfigVars(t *testing.T) {- got, err := parseConfigVars([]string{"MODE=fast", "EMPTY="})- if err != nil {- t.Fatal(err)- }- if got["MODE"] != "fast" || got["EMPTY"] != "" {- t.Fatalf("parsed = %#v", got)- }- if _, err := parseConfigVars([]string{"BROKEN"}); err == nil {- t.Fatal("expected malformed --var to fail")- }}func TestDeployFlueBlocksOnLeakedKey(t *testing.T) {diff --git a/sdks/flue/src/gateway.test.ts b/sdks/flue/src/gateway.test.tsnew file mode 100644index 00000000..6226dec0--- /dev/null+++ b/sdks/flue/src/gateway.test.ts@@ -0,0 +1,25 @@+import { describe, expect, it, vi } from "vitest";++const mocks = vi.hoisted(() => ({ registerProvider: vi.fn() }));++vi.mock("@flue/runtime", () => ({ registerProvider: mocks.registerProvider }));+vi.mock("./cf-env.js", () => ({+ ocResolveEnv: () => ({ OC_GATEWAY: "https://gateway.test" }),+}));++import { route } from "./gateway.js";++describe("Flue gateway binding", () => {+ it("binds the deploy token once and a tokenless request cannot overwrite it", async () => {+ const next = vi.fn(async () => undefined);+ await route({ env: { OC_SESSION_TOKEN: "deploy-token" } } as never, next);+ await route({ env: {} } as never, next);++ expect(mocks.registerProvider).toHaveBeenCalledTimes(1);+ expect(mocks.registerProvider).toHaveBeenCalledWith("anthropic", {+ baseUrl: "https://gateway.test/anthropic",+ apiKey: "deploy-token",+ });+ expect(next).toHaveBeenCalledTimes(2);+ });+});diff --git a/sdks/flue/src/gateway.ts b/sdks/flue/src/gateway.tsindex 5cf20cfa..3c21dd54 100644--- a/sdks/flue/src/gateway.ts+++ b/sdks/flue/src/gateway.ts@@ -8,10 +8,9 @@// The secret DOES live on the per-REQUEST env (`c.env`) — the same source ocSandbox reads at run time.// Fix: bind the apiKey at RUN scope from the exported `route` middleware, reading OC_SESSION_TOKEN from// `c.env` by DIRECT property access (NEVER spread c.env — the CF env is a proxy and spreading it throws)-// and OC_GATEWAY from the ambient snapshot. The token is per-DEPLOY (identical for every session), so-// rebinding it is race-free. The route also sets a best-effort X-OC-Session header; that static registry-// header can race under co-location and is never an authorization boundary. Exact attribution still needs-// the upstream per-request headers(ctx) resolver.+// and OC_GATEWAY from the ambient snapshot, once per isolate. The token is per-DEPLOY (identical for+// every session), so the module-scoped provider registry needs one stable binding and no per-session+// mutation. Exact attribution remains an upstream per-request headers(ctx) concern.import { registerProvider } from "@flue/runtime";import type { AgentInitializerContext, AgentRouteHandler } from "@flue/runtime";@@ -27,7 +26,7 @@ export const DEFAULT_MODEL = "anthropic/claude-haiku-4-5";export interface OcEnv {/** Deployed gateway Worker base URL (set per tenant script by the OC deploy). */OC_GATEWAY?: string;- /** Signed session/deploy JWT the gateway verifies (`{sub, org, agt, bud}`); never a raw provider key. */+ /** Signed deploy JWT the gateway verifies (`{org, agt, ep}`); never a raw provider key. */OC_SESSION_TOKEN?: string;/** Telemetry sink for `observe()` (operator panel + spend attribution). */OC_INGEST?: string;@@ -38,13 +37,12 @@ export interface OcEnv {* model specifier resolves); attaches the apiKey only when the per-deploy OC_SESSION_TOKEN is present in* this snapshot. Returns true only when the apiKey actually landed — callers use that to stop rebinding.* No-op when OC_GATEWAY is unset (local `flue dev` falls through to pi-ai's env-var key lookup). */-function bindOcProvider(env: OcEnv, sessionId?: string): boolean {+function bindOcProvider(env: OcEnv): boolean {const gw = env.OC_GATEWAY;if (!gw) return false;registerProvider("anthropic", {baseUrl: `${gw.replace(/\/+$/, "")}/anthropic`,...(env.OC_SESSION_TOKEN ? { apiKey: env.OC_SESSION_TOKEN } : {}),- ...(sessionId ? { headers: { "X-OC-Session": sessionId } } : {}),});return Boolean(env.OC_SESSION_TOKEN);}@@ -62,13 +60,16 @@ export function useOcGateway(ctx: AgentInitializerContext<OcEnv>): void {bindOcProvider(ocResolveEnv<OcEnv>(ctx.env));}+/** Set only after the run-scope secret lands. A tokenless read can never overwrite a working+ * isolate-global provider binding. */+let ocProviderBound = false;+/*** The HTTP-transport opt-in every OC-hosted agent MUST export as `route` (an agent is reachable at* `/agents/:name/:id` only when its module exports `route` — flue-app.ts). ALSO the run-scope binder for- * the token seam: on each request (where the request ALS is entered and OC_SESSION_TOKEN is readable) it- * (re)binds the provider's apiKey and best-effort session attribution BEFORE the turn's model call- * runs via `next()`. The provider registry is isolate-global, so the session header is visibility-only- * until Flue exposes a per-request provider resolver; hard enforcement remains org+agent in the token.+ * the token seam: on the first request carrying OC_SESSION_TOKEN it binds the provider's apiKey before+ * the turn's model call runs via `next()`. The provider registry is isolate-global and the token is+ * deploy-static, so later requests must not mutate it.* The OC dispatch Worker is the auth boundary (013 §3 B5), so the transport itself adds none.*/export const route: AgentRouteHandler = async (c, next) => {@@ -77,9 +78,10 @@ export const route: AgentRouteHandler = async (c, next) => {// key"). The secret IS on the REQUEST env (c.env) — the same source ocSandbox reads in createSessionEnv.// Read the token from c.env by DIRECT property access (never spread c.env — the CF env is a proxy and// spreading it throws, which would break the request), and take OC_GATEWAY from the ambient snapshot.- const amb = ocResolveEnv<OcEnv>(undefined);- const token = (c.env as OcEnv | undefined)?.OC_SESSION_TOKEN ?? amb.OC_SESSION_TOKEN;- const sessionId = c.req.param("id") || undefined;- bindOcProvider({ ...amb, ...(token ? { OC_SESSION_TOKEN: token } : {}) }, sessionId);+ if (!ocProviderBound) {+ const amb = ocResolveEnv<OcEnv>(undefined);+ const token = (c.env as OcEnv | undefined)?.OC_SESSION_TOKEN ?? amb.OC_SESSION_TOKEN;+ ocProviderBound = bindOcProvider({ ...amb, ...(token ? { OC_SESSION_TOKEN: token } : {}) });+ }return next();};diff --git a/sdks/typescript/src/agents/agents.ts b/sdks/typescript/src/agents/agents.tsindex 90c81b35..c45d8372 100644--- a/sdks/typescript/src/agents/agents.ts+++ b/sdks/typescript/src/agents/agents.ts@@ -5,7 +5,6 @@ import {type Deployment, type InlineSkillFile,} from "./deployments.js";import { Schedules } from "./schedules.js";-import { AgentConfigResource } from "./config.js";export interface CreateAgentParams {name: string;@@ -72,8 +71,6 @@ export class Agents {readonly deploymentSource: DeploymentSourceResource;/** Cron for agents — schedules that fire a session per slot (015). */readonly schedules: Schedules;- /** Flue Worker vars, outbound host policy, and write-only secrets. */- readonly config: AgentConfigResource;constructor(private readonly http: Http) {this.deployments = new Deployments(http);@@ -82,7 +79,6 @@ export class Agents {this.skills = new Skills(http);this.deploymentSource = new DeploymentSourceResource(http);this.schedules = new Schedules(http);- this.config = new AgentConfigResource(http);}create(params: CreateAgentParams): Promise<Agent> {diff --git a/sdks/typescript/src/agents/config.test.ts b/sdks/typescript/src/agents/config.test.tsdeleted file mode 100644index 1b7354dc..00000000--- a/sdks/typescript/src/agents/config.test.ts+++ /dev/null@@ -1,37 +0,0 @@-import { describe, expect, it, vi } from "vitest";-import { OpenComputer } from "./client.js";--describe("Flue agent config", () => {- it("normalizes config and serializes replacement writes", async () => {- const calls: Array<{ url: string; init?: RequestInit }> = [];- const fetch = vi.fn(async (input: string | URL | Request, init?: RequestInit) => {- calls.push({ url: String(input), init });- if (init?.method === "PUT") {- return Response.json({ vars: { MODE: "safe" }, egress_allowlist: ["api.example.com"], deployment_required: true });- }- return Response.json({ vars: {}, egress_allowlist: [] });- });- const oc = new OpenComputer({ apiKey: "test", baseUrl: "https://cp.example/v3", fetch: fetch as typeof globalThis.fetch });-- const saved = await oc.agents.config.put("agt_1", {- vars: { MODE: "safe" }, egressAllowlist: ["api.example.com"],- });-- expect(saved.egressAllowlist).toEqual(["api.example.com"]);- expect(saved.deploymentRequired).toBe(true);- expect(calls[0]?.url).toBe("https://cp.example/v3/agents/agt_1/config");- expect(JSON.parse(String(calls[0]?.init?.body))).toEqual({- vars: { MODE: "safe" }, egress_allowlist: ["api.example.com"],- });- });-- it("never expects values when listing write-only secrets", async () => {- const fetch = vi.fn(async () => Response.json({- data: [{ name: "GITHUB_TOKEN", last4: "1234", updated_at: "2026-07-12T00:00:00Z", sync_status: "synced" }],- }));- const oc = new OpenComputer({ apiKey: "test", baseUrl: "https://cp.example/v3", fetch: fetch as typeof globalThis.fetch });- const secrets = await oc.agents.config.listSecrets("agt_1");- expect(secrets).toEqual([{ name: "GITHUB_TOKEN", last4: "1234", updatedAt: "2026-07-12T00:00:00Z", syncStatus: "synced" }]);- expect(secrets[0]).not.toHaveProperty("value");- });-});diff --git a/sdks/typescript/src/agents/config.ts b/sdks/typescript/src/agents/config.tsdeleted file mode 100644index 0f3f5435..00000000--- a/sdks/typescript/src/agents/config.ts+++ /dev/null@@ -1,52 +0,0 @@-import type { Http } from "./http.js";--/** Non-secret bindings and the fail-closed outbound host policy for a Flue agent. */-export interface FlueAgentConfig {- vars: Record<string, string>;- egressAllowlist: string[];- /** True after a config write because vars are baked into the next deployment. */- deploymentRequired?: boolean;-}--/** Replacement config. Read first when you want merge semantics. */-export interface PutFlueAgentConfigParams {- vars?: Record<string, string>;- egressAllowlist?: string[];-}--/** Write-only secret metadata. The value is never returned. */-export interface FlueAgentSecret {- name: string;- last4: string;- updatedAt: string;- syncStatus: "synced" | "pending_deploy" | "error";-}--/** Flue Worker config and write-only secret bindings (`oc.agents.config`). */-export class AgentConfigResource {- constructor(private readonly http: Http) {}-- get(agentId: string): Promise<FlueAgentConfig> {- return this.http.request("GET", `/agents/${agentId}/config`);- }-- /** Replace non-secret vars and the outbound allowlist. Omitted fields become empty. */- put(agentId: string, params: PutFlueAgentConfigParams): Promise<FlueAgentConfig> {- return this.http.request("PUT", `/agents/${agentId}/config`, { body: params });- }-- /** List names/status only; OpenComputer never returns secret values. */- async listSecrets(agentId: string): Promise<FlueAgentSecret[]> {- const result = await this.http.request<{ data: FlueAgentSecret[] }>("GET", `/agents/${agentId}/secrets`);- return result.data;- }-- /** Create or rotate a secret. A deployed Worker is updated in place when possible. */- setSecret(agentId: string, name: string, value: string): Promise<FlueAgentSecret> {- return this.http.request("PUT", `/agents/${agentId}/secrets/${encodeURIComponent(name)}`, { body: { value } });- }-- deleteSecret(agentId: string, name: string): Promise<void> {- return this.http.request("DELETE", `/agents/${agentId}/secrets/${encodeURIComponent(name)}`);- }-}diff --git a/sdks/typescript/src/agents/index.ts b/sdks/typescript/src/agents/index.tsindex 855d4d96..22f6a680 100644--- a/sdks/typescript/src/agents/index.ts+++ b/sdks/typescript/src/agents/index.ts@@ -37,10 +37,6 @@ export type {Schedule, ScheduleRun, ScheduleState, RunOutcome, Overlap,CreateScheduleParams, UpdateScheduleParams, RunsPage,} from "./schedules.js";-export { AgentConfigResource } from "./config.js";-export type {- FlueAgentConfig, PutFlueAgentConfigParams, FlueAgentSecret,-} from "./config.js";export { verifyWebhook, WebhookVerificationError } from "./webhooks.js";export type { WebhookDelivery, VerifyWebhookOptions } from "./webhooks.js";diff --git a/sdks/typescript/src/agents/normalize.test.ts b/sdks/typescript/src/agents/normalize.test.tsindex 168ddb04..bcadbe24 100644--- a/sdks/typescript/src/agents/normalize.test.ts+++ b/sdks/typescript/src/agents/normalize.test.ts@@ -31,11 +31,6 @@ describe("normalize (API response → idiomatic TS)", () => {});expect(out.refs).toEqual({ pull_number: 42, owner_repo: "acme/widgets", nested: { keep_me: true } });});-- it("passes env binding names through verbatim", () => {- const out = normalize<{ vars?: Record<string, string> }>({ vars: { PUBLIC_MODE: "safe" } });- expect(out.vars).toEqual({ PUBLIC_MODE: "safe" });- });});describe("serialize (request body → snake_case)", () => {@@ -49,9 +44,4 @@ describe("serialize (request body → snake_case)", () => {const out = serialize({ refs: { pullNumber: 42, owner_repo: "acme/widgets" } }) as Record<string, unknown>;expect(out.refs).toEqual({ pullNumber: 42, owner_repo: "acme/widgets" });});-- it("leaves env binding names opaque on request bodies", () => {- const out = serialize({ vars: { PUBLIC_MODE: "safe" } }) as Record<string, unknown>;- expect(out.vars).toEqual({ PUBLIC_MODE: "safe" });- });});diff --git a/sdks/typescript/src/agents/normalize.ts b/sdks/typescript/src/agents/normalize.tsindex 2c609666..23cb8fbb 100644--- a/sdks/typescript/src/agents/normalize.ts+++ b/sdks/typescript/src/agents/normalize.ts@@ -1,8 +1,8 @@// Normalize API responses to idiomatic TS: snake_case keys → camelCase, and a known set// of numeric fields that the API serializes as strings (bigints) → numbers. Opaque// subtrees are passed through untouched: `raw` (source-specific adapter data),-// `metadata`, `refs`, and `vars` (caller-owned routing/config JSON — must-// round-trip verbatim, keys included).+// `metadata`, and `refs` (caller-owned routing JSON — must round-trip verbatim,+// keys included).const NUMERIC = new Set(["seq", "head", "inputCursor", "inputFromSeq", "inputToSeq", "exitCode", "bytes", "port",@@ -18,7 +18,7 @@ export function normalize<T = any>(value: unknown): T {const out: Record<string, unknown> = {};for (const [k, v] of Object.entries(value as Record<string, unknown>)) {const ck = camel(k);- if (ck === "raw" || ck === "metadata" || ck === "refs" || ck === "vars") { out[ck] = v; continue; } // opaque: verbatim, keys untouched+ if (ck === "raw" || ck === "metadata" || ck === "refs") { out[ck] = v; continue; } // opaque: verbatim, keys untouchedlet nv: unknown = normalize(v);if (NUMERIC.has(ck) && typeof nv === "string" && nv !== "" && !Number.isNaN(Number(nv))) {nv = Number(nv);@@ -34,7 +34,7 @@ export function normalize<T = any>(value: unknown): T {// snake_case). Values are left untouched, and opaque/user-owned subtrees (raw, body,// metadata, refs, input) are passed through without key-mangling.const snakeKey = (k: string): string => k.replace(/[A-Z]/g, (c) => "_" + c.toLowerCase());-const OPAQUE = new Set(["raw", "body", "metadata", "refs", "input", "vars"]);+const OPAQUE = new Set(["raw", "body", "metadata", "refs", "input"]);export function serialize(value: unknown): unknown {if (Array.isArray(value)) return value.map((v) => serialize(v));diff --git a/web/src/api/client.ts b/web/src/api/client.tsindex 9e1ed343..0923fbdc 100644--- a/web/src/api/client.ts+++ b/web/src/api/client.ts@@ -32,8 +32,6 @@ export type {AgentSkills,SkillItem,AgentDeploy,- FlueAgentConfig,- FlueAgentSecret,Session,AgentSnapshot,SessionEvent,@@ -90,11 +88,7 @@ function errorMessage(body: unknown, status: number): string {function errorType(body: unknown): string | undefined {if (body && typeof body === 'object') {const err = (body as Record<string, unknown>).error- if (- err &&- typeof err === 'object' &&- typeof (err as Record<string, unknown>).type === 'string'- ) {+ if (err && typeof err === 'object' && typeof (err as Record<string, unknown>).type === 'string') {return (err as Record<string, unknown>).type as string}}@@ -145,11 +139,7 @@ export async function apiFetch<T>(if (!res.ok) {const body: unknown = await res.json().catch(() => ({}))- throw new ApiError(- errorMessage(body, res.status),- res.status,- errorType(body),- )+ throw new ApiError(errorMessage(body, res.status), res.status, errorType(body))}if (res.status === 204) {@@ -471,47 +461,13 @@ export const updateAgent = (S.AgentSchema,)-// Flue Worker config. PUT is a replacement operation, so UI/SDK callers that-// want merge semantics read first and send both vars + egress_allowlist.-export const getFlueAgentConfig = (id: string) =>- apiFetch(`/v3/agents/${id}/config`, {}, S.FlueAgentConfigSchema)--export const putFlueAgentConfig = (- id: string,- body: { vars: Record<string, string>; egress_allowlist: string[] },-) =>- apiFetch(- `/v3/agents/${id}/config`,- { method: 'PUT', body: JSON.stringify(body) },- S.FlueAgentConfigSchema,- )--export const getFlueAgentSecrets = (id: string) =>- apiFetch(`/v3/agents/${id}/secrets`, {}, S.FlueAgentSecretListSchema).then(- (r) => r.data,- )--export const putFlueAgentSecret = (id: string, name: string, value: string) =>- apiFetch(- `/v3/agents/${id}/secrets/${encodeURIComponent(name)}`,- { method: 'PUT', body: JSON.stringify({ value }) },- S.FlueAgentSecretSchema,- )--export const deleteFlueAgentSecret = (id: string, name: string) =>- apiFetch<void>(`/v3/agents/${id}/secrets/${encodeURIComponent(name)}`, {- method: 'DELETE',- })-// Agent Revisions (design 009) — the deploy history of an agent's behavior. List// endpoints wrap rows in { data: [...] }; callers want the array. Rollback = activate// an earlier revision (by id or number); it moves the production pointer.export const getAgentRevisions = (agentId: string) =>- apiFetch(- `/v3/agents/${agentId}/revisions`,- {},- S.AgentRevisionListSchema,- ).then((r) => r.data)+ apiFetch(`/v3/agents/${agentId}/revisions`, {}, S.AgentRevisionListSchema).then(+ (r) => r.data,+ )export const getAgentDeploys = (agentId: string) =>apiFetch(`/v3/agents/${agentId}/deploys`, {}, S.AgentDeployListSchema).then(@@ -559,36 +515,22 @@ export interface ScheduleRun {}export const getSchedules = (agentId: string) =>- apiFetch<{ schedules: Schedule[] }>(`/v3/agents/${agentId}/schedules`).then(- (r) => r.schedules,- )+ apiFetch<{ schedules: Schedule[] }>(`/v3/agents/${agentId}/schedules`).then((r) => r.schedules)export const createSchedule = (agentId: string,- body: {- name: string- cron: string- tz?: string | null- input: string- overlap?: ScheduleOverlap- },+ body: { name: string; cron: string; tz?: string | null; input: string; overlap?: ScheduleOverlap },) =>- apiFetch<{ schedule: Schedule }>(`/v3/agents/${agentId}/schedules`, {- method: 'POST',- body: JSON.stringify(body),- }).then((r) => r.schedule)+ apiFetch<{ schedule: Schedule }>(+ `/v3/agents/${agentId}/schedules`,+ { method: 'POST', body: JSON.stringify(body) },+ ).then((r) => r.schedule)// PATCH accepts any of { cron, tz, input, overlap, paused }. `paused` toggles pause/resume.export const updateSchedule = (agentId: string,scheduleId: string,- body: Partial<{- cron: string- tz: string | null- input: string- overlap: ScheduleOverlap- paused: boolean- }>,+ body: Partial<{ cron: string; tz: string | null; input: string; overlap: ScheduleOverlap; paused: boolean }>,) =>apiFetch<{ schedule: Schedule }>(`/v3/agents/${agentId}/schedules/${scheduleId}`,@@ -596,9 +538,7 @@ export const updateSchedule = ().then((r) => r.schedule)export const deleteSchedule = (agentId: string, scheduleId: string) =>- apiFetch<void>(`/v3/agents/${agentId}/schedules/${scheduleId}`, {- method: 'DELETE',- })+ apiFetch<void>(`/v3/agents/${agentId}/schedules/${scheduleId}`, { method: 'DELETE' })// Test-fire now — enacts synchronously (a failed fire still returns a run with outcome:"failed").export const fireSchedule = (agentId: string, scheduleId: string) =>@@ -607,11 +547,7 @@ export const fireSchedule = (agentId: string, scheduleId: string) =>{ method: 'POST', body: JSON.stringify({}) },).then((r) => r.run)-export const getScheduleRuns = (- agentId: string,- scheduleId: string,- limit = 10,-) =>+export const getScheduleRuns = (agentId: string, scheduleId: string, limit = 10) =>apiFetch<{ runs: ScheduleRun[]; next_cursor: string | null }>(`/v3/agents/${agentId}/schedules/${scheduleId}/runs?limit=${limit}`,).then((r) => r.runs)@@ -626,42 +562,24 @@ export const getAgentSkills = (agentId: string) =>export const putAgentSkills = (agentId: string, zip: File | Blob) =>apiFetch(`/v3/agents/${agentId}/skills`,- {- method: 'PUT',- body: zip,- headers: { 'Content-Type': 'application/zip' },- },+ { method: 'PUT', body: zip, headers: { 'Content-Type': 'application/zip' } },S.DeployResultSchema,)// Remove all skills → deploys a revision from the active behavior with no skills.export const deleteAgentSkills = (agentId: string) =>- apiFetch(- `/v3/agents/${agentId}/skills`,- { method: 'DELETE' },- S.DeployResultSchema,- )+ apiFetch(`/v3/agents/${agentId}/skills`, { method: 'DELETE' }, S.DeployResultSchema)// The OC GitHub App (deploy) install-state + pickable repos — org-scoped admin read.-export const getDeployApp = () =>- apiFetch('/v3/github/deploy-app', {}, S.DeployAppSchema)+export const getDeployApp = () => apiFetch('/v3/github/deploy-app', {}, S.DeployAppSchema)// Deployment source — link an agent to a repo dir for push-to-deploy (deploy-from-github).export const getDeploymentSource = (agentId: string) =>- apiFetch(- `/v3/agents/${agentId}/deployment-source`,- {},- S.DeploymentSourceResponseSchema,- )+ apiFetch(`/v3/agents/${agentId}/deployment-source`, {}, S.DeploymentSourceResponseSchema)export const linkDeploymentSource = (agentId: string,- body: {- repo: string- path: string- production_ref?: string- deploy_now?: boolean- },+ body: { repo: string; path: string; production_ref?: string; deploy_now?: boolean },) =>apiFetch(`/v3/agents/${agentId}/deployment-source`,@@ -670,9 +588,7 @@ export const linkDeploymentSource = ()export const unlinkDeploymentSource = (agentId: string) =>- apiFetch<void>(`/v3/agents/${agentId}/deployment-source`, {- method: 'DELETE',- })+ apiFetch<void>(`/v3/agents/${agentId}/deployment-source`, { method: 'DELETE' })// Deploy the linked repo's current production-branch HEAD now (no git push needed).// Returns { deployment } — fire-and-refetch, so we don't validate the body.@@ -763,12 +679,7 @@ export const rotateCredential = (id: string, key: string) =>// Sessions — the durable runs.export const getSessions = (- params: {- agent?: string- status?: string- limit?: number- cursor?: string- } = {},+ params: { agent?: string; status?: string; limit?: number; cursor?: string } = {},) => {const q = new URLSearchParams()if (params.agent) q.set('agent', params.agent)@@ -830,9 +741,11 @@ export const getSessionEvents = (id: string, level?: string) =>// Turns — the per-submission execution records behind a session (state, timing,// usage, error). Read-only; powers the submission-health panel. Newest first.export const getSessionTurns = (id: string) =>- apiFetch(`/v3/sessions/${id}/turns`, {}, S.SessionTurnListSchema).then(- (r) => r.data,- )+ apiFetch(+ `/v3/sessions/${id}/turns`,+ {},+ S.SessionTurnListSchema,+ ).then((r) => r.data)// The latest turn + its result event (if the turn produced one).export const getSessionResult = (id: string) =>diff --git a/web/src/api/mock.ts b/web/src/api/mock.tsindex e4feca9c..31173625 100644--- a/web/src/api/mock.ts+++ b/web/src/api/mock.ts@@ -472,37 +472,6 @@ const agents = [revision: 1,created_at: at(6),},- {- id: 'agt_flue_demo',- name: 'Issue Fixer',- prompt: null,- prompt_hash: null,- model: 'anthropic/claude-haiku-4-5',- runtime: 'flue',- credential_id: 'managed',- revision: 4,- created_at: at(2),- },-]--const flueConfig = {- vars: { LOG_LEVEL: 'info', PUBLIC_MODE: 'careful' },- egress_allowlist: ['api.github.com', '*.linear.app'],-}--const flueSecrets = [- {- name: 'LINEAR_API_KEY',- last4: '8fa2',- updated_at: at(1),- sync_status: 'synced',- },- {- name: 'SENTRY_DSN',- last4: '91bc',- updated_at: at(3),- sync_status: 'pending_deploy',- },]// ── Deploy from GitHub (admin) ───────────────────────────────────────────────@@ -837,10 +806,7 @@ const sessionTurns = [completed_at: at(0, 2),active_seconds: 2.1,usage: {},- error: {- code: 'provision_infra',- message: 'brain sandbox failed to start',- },+ error: { code: 'provision_infra', message: 'brain sandbox failed to start' },},]@@ -957,8 +923,6 @@ const ROUTES: Array<[RegExp, Handler]> = [[/^\/agents$/, () => []],// Durable Agent Sessions — lists return the { data: [...] } envelope.[/^\/v3\/agents\/[^/]+\/slack$/, () => slackConnection],- [/^\/v3\/agents\/[^/]+\/config$/, () => flueConfig],- [/^\/v3\/agents\/[^/]+\/secrets$/, () => ({ data: flueSecrets })],[/^\/v3\/github\/deploy-app$/, () => deployApp],[/^\/v3\/agents\/[^/]+\/deployment-source$/,@@ -968,7 +932,6 @@ const ROUTES: Array<[RegExp, Handler]> = [[/^\/v3\/agents\/[^/]+\/deploys$/, () => ({ data: agentDeploys })],[/^\/v3\/agents\/[^/]+\/revisions$/, () => ({ data: agentRevisions })],[/^\/v3\/agents\/[^/]+\/skills$/, () => agentSkills],- [/^\/v3\/agents\/agt_flue_demo$/, () => agents[2]],[/^\/v3\/agents\/[^/]+$/, () => agents[0]],[/^\/v3\/agents$/, () => ({ data: agents })],[/^\/v3\/credentials$/, () => ({ data: credentials })],@@ -996,19 +959,6 @@ const ROUTES: Array<[RegExp, Handler]> = [// Mutations the preview needs to echo something parseable (e.g. the Slack// wizard's POST …/slack/manifest → manifest+steps). Everything else 204-ish.const POST_ROUTES: [RegExp, () => unknown][] = [- [- /^\/v3\/agents\/[^/]+\/config$/,- () => ({ ...flueConfig, deployment_required: true }),- ],- [- /^\/v3\/agents\/[^/]+\/secrets\/[^/]+$/,- () => ({- name: 'NEW_SECRET',- last4: 'cdef',- updated_at: at(0),- sync_status: 'synced',- }),- ],[/^\/v3\/agents\/[^/]+\/slack\/manifest$/, () => slackManifest],[/^\/v3\/agents\/[^/]+\/slack$/,diff --git a/web/src/api/schemas.ts b/web/src/api/schemas.tsindex d9abfbb9..16469e98 100644--- a/web/src/api/schemas.ts+++ b/web/src/api/schemas.ts@@ -345,23 +345,6 @@ export const AgentListSchema = z.object({next_cursor: z.string().nullish(),})-// Flue Worker bindings. Vars are intentionally plain/readable; secret values-// are write-only and only their metadata crosses back into the dashboard.-export const FlueAgentConfigSchema = z.object({- vars: z.record(z.string(), z.string()),- egress_allowlist: z.array(z.string()),- deployment_required: z.boolean().optional(),-})-export const FlueAgentSecretSchema = z.object({- name: z.string(),- last4: z.string(),- updated_at: z.string(),- sync_status: z.string(),-})-export const FlueAgentSecretListSchema = z.object({- data: z.array(FlueAgentSecretSchema),-})-// Agent Revisions (design 009) — immutable deployed versions of an agent's behavior.// `active` flags the production pointer; rollback = activate an earlier revision.export const AgentRevisionSchema = z.object({@@ -622,8 +605,6 @@ export const DeliverySchema = z.object({})export type Agent = z.infer<typeof AgentSchema>-export type FlueAgentConfig = z.infer<typeof FlueAgentConfigSchema>-export type FlueAgentSecret = z.infer<typeof FlueAgentSecretSchema>export type AgentRevision = z.infer<typeof AgentRevisionSchema>export type AgentSkills = z.infer<typeof AgentSkillsSchema>export type SkillItem = z.infer<typeof SkillItemSchema>diff --git a/web/src/components/agent-flue-config.tsx b/web/src/components/agent-flue-config.tsxdeleted file mode 100644index e8247564..00000000--- a/web/src/components/agent-flue-config.tsx+++ /dev/null@@ -1,500 +0,0 @@-import { useState } from 'react'-import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'-import { Plus, Trash2 } from 'lucide-react'-import {- deleteFlueAgentSecret,- getFlueAgentConfig,- getFlueAgentSecrets,- putFlueAgentConfig,- putFlueAgentSecret,- type FlueAgentConfig,- type FlueAgentSecret,-} from '@/api/client'-import { ConfirmDialog } from '@/components/confirm-dialog'-import { Field, FieldError, Input, Textarea } from '@/components/form'-import {- Panel,- PanelContent,- PanelDescription,- PanelHeader,- PanelTitle,-} from '@/components/panel'-import { Badge } from '@/components/ui/badge'-import { Button } from '@/components/ui/button'-import { Skeleton } from '@/components/ui/skeleton'-import { notifyError, notifySuccess } from '@/lib/errors'-import { cn } from '@/lib/utils'--const BINDING_NAME = /^[A-Z][A-Z0-9_]{0,63}$/--type BindingRow = { id: string; name: string; value: string }--const bindingRows = (vars: Record<string, string>): BindingRow[] =>- Object.entries(vars)- .sort(([a], [b]) => a.localeCompare(b))- .map(([name, value]) => ({ id: crypto.randomUUID(), name, value }))--function normalizedHosts(value: string): string[] {- return [- ...new Set(- value- .split(/[,\n]/)- .map((host) => host.trim().toLowerCase())- .filter(Boolean),- ),- ].sort()-}--function validHost(value: string): boolean {- const host = value.startsWith('*.') ? value.slice(2) : value- return (- value.length <= 253 &&- !value.includes('://') &&- !value.includes('/') &&- !value.includes(':') &&- /^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/.test(host) &&- host.includes('.')- )-}--function payloadFor(rows: BindingRow[], egress: string) {- const vars: Record<string, string> = {}- for (const row of rows) {- const name = row.name.trim()- if (name) vars[name] = row.value- }- return { vars, egress_allowlist: normalizedHosts(egress) }-}--function configIssue(rows: BindingRow[], egress: string): string | null {- const populated = rows.filter((row) => row.name.trim() || row.value)- const names = populated.map((row) => row.name.trim())- if (names.some((name) => !name)) return 'Every value needs a variable name.'- const invalid = names.find(- (name) =>- !BINDING_NAME.test(name) ||- name.startsWith('OC_') ||- name.startsWith('FLUE_'),- )- if (invalid)- return `${invalid} is invalid or reserved. Use uppercase letters, numbers, and underscores.`- if (new Set(names).size !== names.length)- return 'Variable names must be unique.'- const badHost = normalizedHosts(egress).find((host) => !validHost(host))- if (badHost) return `${badHost} is not a valid hostname.`- return null-}--export function AgentFlueConfig({ agentId }: { agentId: string }) {- const config = useQuery({- queryKey: ['agent-flue-config', agentId],- queryFn: () => getFlueAgentConfig(agentId),- })- const secrets = useQuery({- queryKey: ['agent-flue-secrets', agentId],- queryFn: () => getFlueAgentSecrets(agentId),- })-- if (config.isLoading || secrets.isLoading) {- return (- <div className="space-y-6" aria-label="Loading Worker configuration">- <Skeleton className="h-72 w-full" />- <Skeleton className="h-56 w-full" />- </div>- )- }-- return (- <>- {config.data ? (- <ConfigEditor agentId={agentId} config={config.data} />- ) : (- <LoadFailure- label="Worker configuration"- retry={() => void config.refetch()}- />- )}- {secrets.data ? (- <SecretEditor agentId={agentId} secrets={secrets.data} />- ) : (- <LoadFailure- label="Worker secrets"- retry={() => void secrets.refetch()}- />- )}- </>- )-}--function ConfigEditor({- agentId,- config,-}: {- agentId: string- config: FlueAgentConfig-}) {- const queryClient = useQueryClient()- const [rows, setRows] = useState<BindingRow[]>(() => bindingRows(config.vars))- const [egress, setEgress] = useState(() => config.egress_allowlist.join('\n'))- const issue = configIssue(rows, egress)- const payload = payloadFor(rows, egress)- const current = payloadFor(- bindingRows(config.vars),- config.egress_allowlist.join('\n'),- )- const dirty = JSON.stringify(payload) !== JSON.stringify(current)-- const save = useMutation({- mutationFn: () => putFlueAgentConfig(agentId, payload),- onSuccess: (saved) => {- queryClient.setQueryData(['agent-flue-config', agentId], saved)- notifySuccess(- 'Worker configuration saved.',- 'Variables apply on the next deploy. Outbound policy updates shortly.',- )- },- onError: (error) =>- notifyError("Couldn't save Worker configuration.", error),- })-- return (- <Panel>- <PanelHeader>- <div className="space-y-1">- <PanelTitle>Worker environment</PanelTitle>- <PanelDescription>- Non-secret bindings and the hosts this agent may call over HTTPS.- </PanelDescription>- </div>- </PanelHeader>- <PanelContent className="space-y-6">- <section aria-labelledby="flue-vars-heading" className="space-y-3">- <div className="flex flex-wrap items-start justify-between gap-3">- <div className="space-y-1">- <h3 id="flue-vars-heading" className="text-sm font-medium">- Variables- </h3>- <p className="text-muted-foreground max-w-2xl text-xs">- These values are readable configuration. Put credentials and- tokens in Worker secrets below.- </p>- </div>- <Button- type="button"- variant="outline"- size="sm"- onClick={() =>- setRows((old) => [- ...old,- { id: crypto.randomUUID(), name: '', value: '' },- ])- }- >- <Plus aria-hidden />- Add variable- </Button>- </div>-- {rows.length ? (- <div className="space-y-2">- {rows.map((row, index) => (- <div- key={row.id}- className="flex flex-col gap-2 sm:flex-row sm:items-center"- >- <Input- aria-label={`Variable ${index + 1} name`}- value={row.name}- onChange={(event) =>- setRows((old) =>- old.map((item) =>- item.id === row.id- ? {- ...item,- name: event.target.value.toUpperCase(),- }- : item,- ),- )- }- placeholder="VARIABLE_NAME"- className="font-mono sm:w-2/5"- autoCapitalize="characters"- autoCorrect="off"- spellCheck={false}- />- <Input- aria-label={`Variable ${index + 1} value`}- value={row.value}- onChange={(event) =>- setRows((old) =>- old.map((item) =>- item.id === row.id- ? { ...item, value: event.target.value }- : item,- ),- )- }- placeholder="Value"- className="font-mono sm:flex-1"- spellCheck={false}- />- <Button- type="button"- variant="ghost"- size="icon-sm"- className="self-end sm:self-auto"- aria-label={`Remove ${row.name || `variable ${index + 1}`}`}- onClick={() =>- setRows((old) => old.filter((item) => item.id !== row.id))- }- >- <Trash2 aria-hidden />- </Button>- </div>- ))}- </div>- ) : (- <p className="border-border text-muted-foreground rounded-md border border-dashed px-3 py-4 text-sm">- No variables. This Worker receives only OpenComputer-managed- bindings and secrets.- </p>- )}- </section>-- <Field- label="Allowed outbound hosts"- htmlFor="flue-egress-hosts"- description="One hostname per line. Wildcards such as *.example.com include subdomains. Other external hosts are blocked."- >- <Textarea- id="flue-egress-hosts"- value={egress}- onChange={(event) => setEgress(event.target.value)}- placeholder={'api.example.com\n*.example.net'}- className="min-h-24 font-mono"- autoCapitalize="none"- autoCorrect="off"- spellCheck={false}- />- </Field>-- {issue ? <FieldError>{issue}</FieldError> : null}- <div className="flex flex-wrap items-center justify-between gap-3 border-t pt-4">- <p className="text-muted-foreground text-xs">- Variable changes are included in the next deployment.- </p>- <Button- type="button"- size="sm"- disabled={!dirty || !!issue || save.isPending}- onClick={() => save.mutate()}- >- {save.isPending ? 'Saving…' : 'Save configuration'}- </Button>- </div>- </PanelContent>- </Panel>- )-}--function SecretEditor({- agentId,- secrets,-}: {- agentId: string- secrets: FlueAgentSecret[]-}) {- const queryClient = useQueryClient()- const [name, setName] = useState('')- const [value, setValue] = useState('')- const [deleting, setDeleting] = useState<string | null>(null)- const normalizedName = name.trim().toUpperCase()- const nameIssue =- normalizedName &&- (!BINDING_NAME.test(normalizedName) ||- normalizedName.startsWith('OC_') ||- normalizedName.startsWith('FLUE_'))- ? 'Use an uppercase, non-reserved environment variable name.'- : null-- const refresh = () =>- queryClient.invalidateQueries({ queryKey: ['agent-flue-secrets', agentId] })- const setSecret = useMutation({- mutationFn: () => putFlueAgentSecret(agentId, normalizedName, value),- onSuccess: (saved) => {- setName('')- setValue('')- void refresh()- notifySuccess(- `${saved.name} saved.`,- saved.sync_status === 'synced'- ? 'The deployed Worker was updated.'- : 'It will be included in the next deployment.',- )- },- onError: (error) => {- void refresh()- notifyError("Couldn't finish updating the Worker secret.", error)- },- })- const removeSecret = useMutation({- mutationFn: (secretName: string) =>- deleteFlueAgentSecret(agentId, secretName),- onSuccess: (_result, secretName) => {- setDeleting(null)- void refresh()- notifySuccess(`${secretName} deleted.`)- },- onError: (error) =>- notifyError("Couldn't delete the Worker secret.", error),- })-- return (- <Panel>- <PanelHeader>- <div className="space-y-1">- <PanelTitle>Worker secrets</PanelTitle>- <PanelDescription>- Values are encrypted and write-only. Only the last four characters- are shown after saving.- </PanelDescription>- </div>- </PanelHeader>- <PanelContent className="space-y-5">- <form- className="grid gap-3 sm:grid-cols-[minmax(0,0.8fr)_minmax(0,1.2fr)_auto] sm:items-start"- onSubmit={(event) => {- event.preventDefault()- if (normalizedName && value && !nameIssue) setSecret.mutate()- }}- >- <Field label="Name" htmlFor="flue-secret-name" error={nameIssue}>- <Input- id="flue-secret-name"- value={name}- onChange={(event) => setName(event.target.value.toUpperCase())}- placeholder="API_TOKEN"- className="font-mono"- autoCapitalize="characters"- autoCorrect="off"- spellCheck={false}- />- </Field>- <Field label="Value" htmlFor="flue-secret-value">- <Input- id="flue-secret-value"- type="password"- value={value}- onChange={(event) => setValue(event.target.value)}- placeholder="Paste a new value"- className="font-mono"- autoComplete="new-password"- spellCheck={false}- />- </Field>- <Button- type="submit"- size="sm"- className="sm:mt-6"- disabled={- !normalizedName || !value || !!nameIssue || setSecret.isPending- }- >- {setSecret.isPending ? 'Saving…' : 'Set secret'}- </Button>- </form>-- <div className="border-t">- {secrets.length ? (- secrets.map((secret) => (- <div- key={secret.name}- className="flex flex-wrap items-center gap-x-3 gap-y-2 border-b py-3 last:border-b-0"- >- <div className="min-w-0 flex-1">- <p className="truncate font-mono text-sm font-medium">- {secret.name}- </p>- <p className="text-muted-foreground mt-0.5 text-xs">- ends in <span className="font-mono">{secret.last4}</span> ·- updated {new Date(secret.updated_at).toLocaleDateString()}- </p>- </div>- <SecretSyncStatus value={secret.sync_status} />- <Button- type="button"- variant="destructive"- size="sm"- onClick={() => setDeleting(secret.name)}- >- <Trash2 aria-hidden />- Delete- </Button>- </div>- ))- ) : (- <p className="text-muted-foreground py-5 text-sm">- No Worker secrets have been set.- </p>- )}- </div>- </PanelContent>-- <ConfirmDialog- open={!!deleting}- onOpenChange={(open) => {- if (!open) setDeleting(null)- }}- title={`Delete ${deleting ?? 'secret'}?`}- description="The binding will be removed from the deployed Worker. Requests that depend on it may fail immediately."- confirmLabel="Delete secret"- destructive- pending={removeSecret.isPending}- onConfirm={() => {- if (deleting) removeSecret.mutate(deleting)- }}- />- </Panel>- )-}--function SecretSyncStatus({ value }: { value: string }) {- const pending = value === 'pending_deploy'- const error = value === 'error'- return (- <Badge- variant={error ? 'destructive' : 'outline'}- className={cn(- pending &&- 'bg-status-pending-bg text-status-pending border-transparent',- value === 'synced' &&- 'bg-status-running-bg text-status-running border-transparent',- )}- >- {value === 'pending_deploy'- ? 'Pending deploy'- : value === 'synced'- ? 'Synced'- : 'Sync error'}- </Badge>- )-}--function LoadFailure({ label, retry }: { label: string; retry: () => void }) {- return (- <Panel>- <PanelContent className="flex flex-wrap items-center justify-between gap-3">- <div>- <p className="text-sm font-medium">{label} could not be loaded.</p>- <p className="text-muted-foreground mt-1 text-xs">- Existing Worker state was not changed.- </p>- </div>- <Button type="button" variant="outline" size="sm" onClick={retry}>- Try again- </Button>- </PanelContent>- </Panel>- )-}diff --git a/web/src/components/api-hint.tsx b/web/src/components/api-hint.tsxindex bbfd717c..0724fdcb 100644--- a/web/src/components/api-hint.tsx+++ b/web/src/components/api-hint.tsx@@ -14,9 +14,9 @@ export type ApiRef = {export function ApiHint({ method, path, sdk, docs }: ApiRef) {if (!path && !sdk && !docs) return nullreturn (- <div className="text-muted-foreground/70 flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 overflow-hidden pt-1 text-xs">+ <div className="text-muted-foreground/70 flex flex-wrap items-center gap-x-2.5 gap-y-1 pt-1 text-xs">{path ? (- <span className="max-w-full truncate font-mono">+ <span className="font-mono">{method ? (<span className="text-muted-foreground/50">{method} </span>) : null}@@ -24,7 +24,7 @@ export function ApiHint({ method, path, sdk, docs }: ApiRef) {</span>) : null}{sdk ? (- <span className="text-muted-foreground/50 max-w-full truncate font-mono">+ <span className="text-muted-foreground/50 font-mono">{path ? '· ' : ''}{sdk}</span>diff --git a/web/src/pages/AgentDetail.tsx b/web/src/pages/AgentDetail.tsxindex 7874d30e..71cb0f00 100644--- a/web/src/pages/AgentDetail.tsx+++ b/web/src/pages/AgentDetail.tsx@@ -32,18 +32,12 @@ import { AgentSkills } from '@/components/agent-skills'import { AgentDeploySource } from '@/components/agent-deploy-source'import { AgentSchedulesTab } from '@/components/agent-schedules'import { AgentRevisions } from '@/components/agent-revisions'-import { AgentFlueConfig } from '@/components/agent-flue-config'import {WorkingRepoField,type WorkingRepo,} from '@/components/working-repo-field'import { ApiHint, type ApiRef } from '@/components/api-hint'-import {- getRuntime,- keyFieldFor,- providerForModel,- withModelGroups,-} from '@/lib/runtimes'+import { getRuntime, keyFieldFor, providerForModel, withModelGroups } from '@/lib/runtimes'const DOCS = 'https://docs.opencomputer.dev/agent-sessions'@@ -72,36 +66,11 @@ export default function AgentDetail() {// Each tab is a thin control panel over one API resource — surface the call it drives// (REST + SDK), same as the other pages, so the dashboard reads as programmable.const tabApi: Record<Tab, ApiRef> = {- overview: {- method: 'GET',- path: `/v3/agents/${agentId}`,- sdk: 'oc.agents.get(id)',- docs: `${DOCS}/agents`,- },- revisions: {- method: 'GET',- path: `/v3/agents/${agentId}/revisions`,- sdk: 'oc.agents.revisions.list(id)',- docs: `${DOCS}/revisions`,- },- sessions: {- method: 'POST',- path: '/v3/sessions',- sdk: 'oc.sessions.create({ agent })',- docs: `${DOCS}/sessions`,- },- schedules: {- method: 'GET',- path: `/v3/agents/${agentId}/schedules`,- sdk: 'oc.agents.schedules.list(id)',- docs: `${DOCS}/schedules`,- },- settings: {- method: 'PATCH',- path: `/v3/agents/${agentId}`,- sdk: 'oc.agents.update(id, …)',- docs: `${DOCS}/agents`,- },+ overview: { method: 'GET', path: `/v3/agents/${agentId}`, sdk: 'oc.agents.get(id)', docs: `${DOCS}/agents` },+ revisions: { method: 'GET', path: `/v3/agents/${agentId}/revisions`, sdk: 'oc.agents.revisions.list(id)', docs: `${DOCS}/revisions` },+ sessions: { method: 'POST', path: '/v3/sessions', sdk: 'oc.sessions.create({ agent })', docs: `${DOCS}/sessions` },+ schedules: { method: 'GET', path: `/v3/agents/${agentId}/schedules`, sdk: 'oc.agents.schedules.list(id)', docs: `${DOCS}/schedules` },+ settings: { method: 'PATCH', path: `/v3/agents/${agentId}`, sdk: 'oc.agents.update(id, …)', docs: `${DOCS}/agents` },}const {@@ -160,8 +129,8 @@ export default function AgentDetail() {const location = useLocation()const [task, setTask] = useState(() =>- (location.state as { composerPrefill?: string } | null)- ?.composerPrefill ?? '',+ (location.state as { composerPrefill?: string } | null)?.composerPrefill ??+ '',)// Optional working repo — the repo the agent checks out + opens PRs from. Explicitly chosen,// never derived from the connected/config repo (design 010 §2).@@ -323,7 +292,7 @@ export default function AgentDetail() {<BackLink />{/* Sticky header: identity + status + primary action, with the tab bar. */}- <div className="bg-background sticky top-0 z-20 min-w-0 border-b">+ <div className="bg-background sticky top-0 z-20 border-b"><div className="flex flex-wrap items-start justify-between gap-3 pb-3"><div className="min-w-0 space-y-1.5"><h1 className="text-foreground truncate text-lg font-semibold">@@ -343,7 +312,7 @@ export default function AgentDetail() {</Link></Button></div>- <nav className="-mb-px flex max-w-full gap-1 overflow-x-auto">+ <nav className="-mb-px flex gap-1"><TabLink to={base} label="Overview" current={active === 'overview'} /><TabLinkto={`${base}/revisions`}@@ -627,9 +596,6 @@ export default function AgentDetail() {</p></PanelContent></Panel>- {agent.runtime === 'flue' ? (- <AgentFlueConfig agentId={agent.id} />- ) : null}</div>)}</div>