Skip to content

chore: sync with upstream 2026-09-01 (conflicts) - #123

Draft
NicolasWalter wants to merge 84 commits into
mainfrom
sync/upstream-2026-09-01
Draft

chore: sync with upstream 2026-09-01 (conflicts)#123
NicolasWalter wants to merge 84 commits into
mainfrom
sync/upstream-2026-09-01

Conversation

@NicolasWalter

Copy link
Copy Markdown

Automated upstream sync

⚠️ Conflicts detected — resolve markers before merging.

Upstream: ColeMurray/background-agents@main

This PR was opened automatically by .github/workflows/sync-upstream.yml.

ColeMurray and others added 30 commits August 25, 2026 22:56
…gest closure bags (ColeMurray#1608)

## What

First PR of the deps-style normalization campaign (follow-through on the
ColeMurray#1594ColeMurray#1604 decomposition): replace the composition root's three biggest
closure-bag literals with composition classes, per the house deps
standard from the ColeMurray#1045-series (pass collaborators directly with full
types; give a closure group that shares collaborators a named class).

Behavior-preserving — no port changes, no call-flow changes.

## Changes

- **`DurableObjectSandboxStorage`** (new
`session/sandbox-lifecycle-adapters.ts`) implements the lifecycle
manager's `SandboxStorage` port over its four real collaborators:
`SandboxRepository`, `SessionCoreRepository`, `UserEnvResolver`, and the
secrets encryption key. Replaces the 28-property literal in the root.
The encrypt-before-store rule (code-server/VNC/ttyd secrets), previously
copy-pasted three times inline, is one private `encryptIfConfigured`
method.
- **`LifecycleSocketAdapter`** (same file) implements the manager's
`WebSocketManager` port over `SessionWebSocketManager` — the name
translation and the no-socket send branch get a typed home instead of a
literal.
- **`SessionClientCommandFacade`** (new
`session/client-command-facade.ts`) implements the message router's
`SessionClientCommands<WebSocket, ClientInfo>` port with the four
services as constructor deps. The port itself stays generic — that
genericity is what lets the server stack unit-test over string
connections, so the facade is the production binding, not a port
rewrite. The router's client-message type aliases are now exported (they
are referenced by the exported port, so naming them outside the module
was already implied).

Net: 39 function-valued props removed from `components.ts`; the root now
constructs objects in these three spots instead of authoring behavior
inline.

## Tests

New `sandbox-lifecycle-adapters.test.ts` covers the pieces with real
logic, which previously lived untested inside the root literal: the
encrypt-when-configured branch (round-trips via `decryptToken`), the
plaintext-passthrough branch, the repository-shape defaults
(`baseBranch` → `"main"`, missing row → `baseSha: null`), the
`setLastSpawnError` → `updateSandboxSpawnError` rename, and both
`sendToSandbox` branches. Pure forwards stay covered through the manager
and server suites.

## Queue context

Next in the campaign (separate PRs): handler deps-bags → classes
(normalizing the 7-factory/5-class split), vestigial thunk removal
(`getLogger: () => log` first), and the `test/integration` typecheck
spike.


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

- **Refactor**
- Improved session command handling for prompts, execution controls,
typing indicators, presence, subscriptions, and history.
- Improved sandbox lifecycle and WebSocket handling for more consistent
session connectivity.
- **Security**
- Sandbox access credentials can now be encrypted when configured, while
retaining compatibility with existing setups.
- **Tests**
- Added coverage for credential storage, sandbox startup errors,
repository behavior, and WebSocket communication.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…lve the storage middle-man (ColeMurray#1609)

## What

Campaign item 2, combining two agreed decisions: **the secrets
encryption key is required** (it always was operationally — Terraform
declares it with no default — but the code treated it as optional and
silently fell back to storing plaintext), and **the storage middle-man
from ColeMurray#1608 is dissolved** (its ~25 one-line pass-throughs were the smell
that prompted the design discussion).

## Encryption key is required

- New `requireRepoSecretsEncryptionKey(env)`: the session graph throws
at construction when the key is absent (the ColeMurray#1602 eager posture — a
misconfigured deployment fails every request at initialization instead
of running degraded), and the five MCP-server routes validate the same
way.
- Every plaintext-**write** fallback is deleted: the sandbox
access-secret stores, `McpServerStore`'s keyless branch, and
`UserEnvResolver`'s "skip secret loading" branch.
`isManagedSecretsConfigured` reduces to `Boolean(db)`.
- Plaintext-**read** fallbacks stay: pre-encryption legacy rows still
decrypt-or-degrade exactly as before (`McpServerStore`'s catch fallback,
access values resolving to null on decrypt failure).
- The integration environment already provides a test key in its
miniflare bindings, so no test-infra changes were needed.

## Encryption is owned by persistence; the middle-man is gone

- `SandboxRepository` takes the key at construction and encrypts
code-server/VNC/ttyd secrets inside its write methods — the same pattern
the D1 stores already use. No caller can persist an access secret in the
clear, structurally.
- The manager's conflated port is **split into two roles** — the root
cause behind both the ColeMurray#1608 forwarding layer and an interim inheritance
design. `SandboxStorage` shrinks to the sandbox-row contract, which
`SandboxRepository` now satisfies **structurally** (no adapter, no
subclass, and no manager-port import in the repository — the structural
check happens at the composition boundary). The three session-context
reads become their own `SessionContextReader` port, implemented by a
small `LifecycleSessionContext` facade over `SessionCoreRepository` +
`UserEnvResolver` — an honest adapter: it spans two collaborators and
owns the repository-shape defaults. `DurableObjectSandboxStorage` is
deleted.
- The shared test mock already implements both ports, so the manager's
test harness changes are mechanical: the same fake is passed for both
parameters at every constructor site.
- `updateSandboxSpawnError` is renamed `setLastSpawnError` to match the
port vocabulary, removing the last name translation.

## Tests

Encryption round-trips (via `decryptToken`) now live in
`sandbox-repository.test.ts` with the logic; the adapter tests pin the
context mapping and the inheritance wiring ("sandbox writes hit SQL with
no forwarding layer"). Deleted-behavior tests are deleted with their
behavior: the keyless verbatim-read test, the resolver's
skip-secret-loading test, and ColeMurray#1608's synchronous-keyless-persist test
(that branch no longer exists — with the key required, every secret
write takes the same WebCrypto await it always took on real
deployments). `McpServerStore` tests construct keyed; their
plaintext-seeded rows now exercise the legacy-read fallback, which is
exactly what such rows are.

## Behavior change (intended)

A deployment without `REPO_SECRETS_ENCRYPTION_KEY` now fails loudly at
session initialization and on MCP routes, instead of silently persisting
secrets unencrypted. Valid deployments are unaffected.


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

* **Security**
* Repository secrets encryption is now required for control-plane
operations.
* Sandbox passwords, tokens, credentials, and stored environment secrets
are encrypted before persistence.
* Encryption keys are strictly validated for required format and length.

* **Bug Fixes**
  * Improved handling of unavailable or empty stored secrets.
  * Reduced unnecessary decryption errors for empty credentials.
  * Improved sandbox error reporting.

* **Refactor**
* Streamlined sandbox lifecycle and session-context handling for more
consistent behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

- move the six Python CI jobs into a dedicated `CI (Python)` workflow
- keep the seven Node.js/TypeScript jobs in `CI (TypeScript)`
- trigger each workflow only for its package and root-tooling dependency
surface
- preserve the Markdown-only exclusions added in ColeMurray#1590

## Motivation

The main CI workflow currently runs both ecosystems for every code
change. This split prevents Python-only changes from allocating
TypeScript runners and TypeScript-only changes from allocating Python
runners, while preserving all existing job commands and dependencies.

This is the ecosystem-level step before introducing narrower
package-aware filtering in follow-up PRs.

## Validation

- `npx prettier --check .github/workflows/ci.yml
.github/workflows/ci-python.yml`
- parsed both workflows and verified all 13 original job definitions
remain present
- `git diff --check`

`actionlint` and Go were unavailable in the local environment. The
repository-wide `npm run format:check` also reports a pre-existing
formatting issue in `.opencode/package.json`; both changed workflow
files pass their targeted formatting check.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/6a9584bdf48356904b0771920dcb9482)*

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

* **Chores**
* Added dedicated continuous integration checks for Python linting,
formatting, type checking, and tests.
  * Updated TypeScript validation to run through a dedicated workflow.
* Refined workflow triggers to focus on relevant code and configuration
changes, excluding documentation-only updates.
* Expanded validation coverage for runtime, deployment, and
infrastructure changes.
* Added concurrency controls to cancel outdated runs and strengthened
workflow security settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
while working on ColeMurray#1037 i noticed that the e2b sandboxes started by the
current template were failing to run bun despite being installed by the
dockerfile.

The Dockerfile previously ran the installer like this:

`BUN_INSTALL=/usr/local curl ... | bash`

That environment variable applied to `curl`, not the `bash` process
running the installer. Bun therefore used its default install location,
which was outside the runtime user's PATH.

This change passes `BUN_INSTALL=/usr/local` to `bash` and also adds
`command -v bun` to the template readiness check.


### Before

<img width="1228" height="755" alt="e2b-bun-issue-before"
src="https://github.com/user-attachments/assets/781533c4-5983-4262-bcf8-acb0cdddcf26"
/>

### After

<img width="1231" height="782" alt="e2b-bun-issue-after"
src="https://github.com/user-attachments/assets/7258ce2b-8f53-42f3-9a98-2a8603181fa5"
/>


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

## Summary by CodeRabbit

* **Bug Fixes**
* Template readiness checks now verify that Bun is available before
finalization.
* **Chores**
  * Improved the Bun installation setup during environment creation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…asses (ColeMurray#1612)

## Summary

Item 3 of the deps-style normalization campaign (follow-up to
ColeMurray#1608/ColeMurray#1609): the seven session HTTP handlers still built as
`createXHandler(deps)` factories over deps-bags become classes with
direct constructor collaborators, matching the `SessionDiffsHandler`
(ColeMurray#1047) and `AttachmentsHandler` precedents. One prerequisite commit
makes `TOKEN_ENCRYPTION_KEY` required, mirroring ColeMurray#1609's treatment of
the repo-secrets key.

The deps-bags were where most of the composition root's pure same-name
forwards lived — closures like `getSession: () =>
sessionCoreRepository.getSession()` that exist only because a bag can't
hold the repository itself. Net effect in `components.ts`: 43
function-valued closure lines removed, 8 added back as named per-request
adapters (−35), and all seven `XHandlerDeps` interfaces deleted.

## `TOKEN_ENCRYPTION_KEY` is now required (first commit)

Terraform already requires the key (no default, `sensitive`) and the
`Env` type declares it non-optional — the three falsy-guards were
silent-degradation branches:

- `identity.ts` silently dropped stored SCM tokens from GitHub
enrichment,
- the session graph silently skipped constructing the user token store,
- session init silently discarded a plaintext SCM token instead of
encrypting it.

`requireTokenEncryptionKey(env)` shares the AES-256 material validator
with `requireRepoSecretsEncryptionKey` (strict base64, exactly 32
decoded bytes) and is thrown at session-graph construction, so a
misconfigured deployment fails every request at init rather than
degrading. Plaintext-read paths are untouched.

## Conversion rules (uniform across all seven)

- **Collaborators become constructor params with their real types** —
repositories, services, messenger. `deps.getSession()` →
`this.sessionCoreRepository.getSession()`.
- **Constant thunks become data** — `getDurableObjectId: () =>
durableObjectId` → `durableObjectId: string`;
`isManagedSecretsConfigured: () => Boolean(db)` →
`managedSecretsConfigured: boolean` (fixed at composition).
- **Module functions re-wrapped only to bind composition-time values are
called directly** — `resolvePublicSessionId(session,
this.durableObjectId)`, `parseArtifactMetadata(artifact, this.log)`,
`validateReasoningEffort(model, effort, this.log)`; same instances, same
arguments as the deleted closures.
- **Genuine adapters stay function-typed params** (8 total): the three
per-request token/credential service factories on `SandboxHandler`, the
request-log-scoped `createPullRequest` factory + `getSessionUrl` +
background `triggerPullRequestRefresh` on `PullRequestHandler`, and
`scheduleWarmSandbox` + `cancelSession` on `SessionLifecycleHandler`.
- **Seams stay functions without eta-expansion** — the root passes
`generateId`/`hashToken`/`encryptToken`/`isValidSandboxToken` as bare
module references; `now` defaults to `Date.now` per the
`AttachmentsHandler` precedent.
- **The class replaces the same-named interface**, so the internal route
table (`components.ts` tier 9) is untouched — those wrappers adapt the
uniform route signature to method arities and are not forwards.
- `SessionLifecycleHandler`'s cancel path reuses the lifecycle
`WebSocketManager` port via a `LifecycleSocketAdapter` instance (ColeMurray#1608)
instead of two raw socket forwards; the adapter's `sendToSandbox`
performs the identical resolve-then-send.
- `PullRequestHandler`'s local result-union aliases were byte-identical
to `ParticipantService`'s declared return types and are deleted.

## Behavior notes

- Behavior-preserving except the deliberate key-requirement change
above.
- Tests now exercise the real `resolvePublicSessionId` (via
`session_name` fixtures) and the real `validateReasoningEffort` (whose
catalog answers match what the old stubs returned) instead of stubs.
- One commit per handler group; every commit is independently green.

## Testing

- `tsc --noEmit` (prod + test configs), ESLint, Prettier
- Unit: 205 files / 3186 tests green
- Integration (workerd + real D1): green


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

* **New Features**
* Added validation for the token encryption key used to protect OAuth
tokens.
* Token-based identity enrichment now requires valid encryption-key
configuration.

* **Bug Fixes**
* Improved configuration errors for missing, malformed, or incorrectly
sized encryption keys.

* **Refactor**
* Updated session and HTTP request handling for more consistent
dependency management without changing endpoint behavior.

* **Tests**
* Expanded coverage for encryption-key validation and token-related
session flows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

Behavior-preserving follow-up to ColeMurray#1608/ColeMurray#1609/ColeMurray#1612 (deps-style
normalization, per the ColeMurray#1045ColeMurray#1049 standard): drop the vestigial logger
thunks. Five sites took the session logger as a zero-arg function
(`getLogger: () => Logger` / `getLog: () => Logger`) and called it on
every use; all five are fed a value that is constant after composition,
so they now take `log: Logger` directly.

The thunks existed for the DO-era log swap: `SessionDO` used to reassign
its logger once the public session id resolved, so anything that
captured a logger by value at construction time kept logging the stale
id. That mechanism is gone — the composition root builds one
session-scoped logger whose `session_id` is injected **per emit**
through the latched resolver (`components.ts`: "for every component in
the graph, however early it captured the logger"). The comment in
`sandbox-events.ts` justifying its getter ("The DO swaps its logger for
a request-scoped child during fetch()") described behavior that no
longer exists.

## Changes

| Site | Before | After |
| --- | --- | --- |
| `SessionHttpDispatcher` deps | `getLogger: () => Logger` | `log:
Logger` |
| `SessionMessageRouter` deps | `getLogger: () => Logger` | `log:
Logger` |
| `SessionDisconnectHandler` deps | `getLogger: () => Logger` | `log:
Logger` |
| `SessionSandboxEventProcessor` ctor | `getLog: () => Logger` +
`private get log()` accessor | `private readonly log: Logger` (accessor
deleted; internal `this.log` uses unchanged) |
| `createCloudflareBackgroundTasks` | `getLogger: () => Logger = () =>
log` | `logger: Logger = log` (worker/scheduler callers use the default,
unchanged) |

Composition root: the three `getLogger: () => log` props and two `() =>
log` arguments become `log`.

## What deliberately stays a function

Everything that is genuinely dynamic, per the campaign's classification:

- **Latched resolvers** — `getSessionId` (DO id until the session row
exists, public id after).
- **Live queries** — `getStatus`, `getAuthenticatedClients`,
`getSandboxSocket`, `getProcessingMessageAuthor`, `isSpawning`.
- **Post-init freshness reads** — `getExecutionTimeoutMs`.
- **The SCM provider cell** — `() => scmProvider` reads a mutable `let`
that live-DO integration tests substitute after graph construction.
- **Clock/id seams and adapters** — `now`, `generateId`, action-shaped
deps.

## Testing

- `npm run typecheck -w @open-inspect/control-plane` (both tsconfigs)
clean
- `npm run lint -w @open-inspect/control-plane` clean
- Unit: 3187 passed; integration: 1002 passed


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

## Summary by CodeRabbit

* **Refactor**
* Updated session and background task components to receive logging
instances directly.
* Streamlined error, request, message, disconnect, and sandbox-event
logging.
* Preserved existing session handling, cleanup, reconnection, and close
behavior.

* **Tests**
* Updated automated tests and test setup to match the simplified logging
configuration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

`test/integration/**` (91 files) was never typechecked — eslint covers
`src/` only, and the tsconfigs excluded the directory. Store-signature
drift there has repeatedly survived until runtime (`D1_TYPE_ERROR`
mid-suite; most recently a stale `SandboxRepository` construction found
during ColeMurray#1609). This PR adds `tsconfig.integration.json`, fixes
everything it surfaced (1,033 errors initially, most from one root
cause), and wires it into `npm run typecheck` so CI enforces it from now
on.

## The config

- Extends the production tsconfig with `types:
["@cloudflare/workers-types", "@cloudflare/vitest-pool-workers/types"]`
— the integration files execute inside workerd, so they compile against
workers types **without Node globals** (same boundary rationale as the
prod config; Node-context files like `vitest.integration.config.ts` run
in the Vite host and are not part of this program).
- The pool's `cloudflare:test` declarations live at the package's
`./types` subpath export (v0.16 layout). The old root-package reference
silently loads nothing — which is why the existing `env.d.ts` was
augmenting a `ProvidedEnv` interface that no longer exists.
- `env.d.ts` rewritten to the v0.16 contract: merge the worker's real
`Env` (plus `TEST_MIGRATIONS`) into the `Cloudflare.Env` placeholder
that `env` from `cloudflare:test` is typed as. This one fix collapsed
~900 of the initial errors.
- An experiment narrowing `SESSION` to
`DurableObjectNamespace<SessionDO>` inside the augmentation was
reverted: it makes `Cloudflare.Env` unassignable to the production `Env`
at every `handleRequest(env)` call site. The production `Env` cannot be
narrowed either — importing the DO class from `types.ts` is exactly what
the only-`index.ts`-imports-the-adapter lint exists to prevent. Instead,
stub typing happens at one seam:

## New test seams (all in existing helper files)

| Helper | Why |
| --- | --- |
| `runInSessionDO(stub, cb)` | `runInDurableObject` with the stub typed
as the session DO — the single cast asserting what the SESSION namespace
hosts (43 call sites converted) |
| `ctxOf(instance)` | the DO's `ctx` is `protected` on the
`DurableObject` base class; storage seeding/assertions go through this
one cast |
| `sqlDatabase(env.DB)` | plain assignment (no cast) viewing D1 through
the engine-neutral `SqlDatabase` interface, so tests can `batch()`
store-bound statements (21 sites) |
| `getSetCookies(headers)` | workerd implements `Headers.getSetCookie()`
but this workers-types version doesn't declare it — same cast
`src/routes/browser-auth.ts` carries |

## Latent drift the checker caught (the point of the exercise)

All fixed behavior-preservingly:

- **`AutomationRow` fixtures still carried
`repo_owner`/`repo_name`/`base_branch`/`repo_id`** (6 files) — dead
since repos moved to the `automation_repositories` junction table;
linkage in the affected tests already flows through
`replaceRepositories(...)`.
- **Run fixtures set `concurrency_key`** — it lives on invocations now,
so the seeded value never reached any table. Note for a follow-up: the
scheduler-events "does not block a different concurrency key" test seeds
its active run without any key either way, so it doesn't currently
distinguish per-key scoping from no-key blocking (left as-is; runtime
unchanged).
- **Browser-auth router tests passed a raw `ExecutionContext` where the
router now takes `BackgroundTasks`** (3 files) — worked only because the
failure path never ran. Now wrapped with
`createCloudflareBackgroundTasks`, mirroring `index.ts`.
- **`stubSourceControlProvider` was missing
`resolveCommit`/`listTree`/`readBlob`** — the provider read-surface
added for skills import; stubbed with the suite's existing `notUsedHere`
idiom.
- **A session fixture wrote status `"initializing"`** — removed from the
status vocabulary (ColeMurray#1554); now `"active"`.
- **`generateId({ model: "user" })`** — Better Auth's canonical
generator takes no arguments; the argument was silently ignored.
- **`ensureInitialized` still passed in a `SessionPlatform` stub** —
unthreaded by ColeMurray#1604.
- **Repository skill assignments missing the now-required
`baseBranch`**, and **image-build correlation contexts missing the
required `trace_id`**.

Plus mechanical strictness fixes (WebCrypto union narrowing in the
Google id-token helper, `json<T>()` typing, non-null assertions where
`subscribe: true` guarantees replay messages).

`session-do-access.ts`'s old comment — "test/integration/** is never
typechecked (eslint + grep are the only static gates here)" — is
retired.

## Testing

- `npm run typecheck` (now three programs) clean
- Unit: 3187 passed; integration: 1002 passed — no behavioral change
- Prettier over the touched files


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

* **Tests**
* Improved integration-test coverage and type-checking across
authentication, sessions, automations, scheduling, webhooks, and Durable
Object workflows.
* Updated test infrastructure for more reliable cookie handling,
database batching, background tasks, and session state access.
* Refined fixtures and assertions to reflect current repository,
concurrency, and session behavior.
* **Chores**
* Updated test TypeScript configurations and runtime type definitions
for improved validation and editor support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

- count bridge heartbeats as sandbox activity while a message is
processing
- keep idle heartbeats liveness-only so abandoned sandboxes still reach
inactivity cleanup
- add unit and Durable Object integration coverage for both states

## Motivation

A long-running tool call can emit no agent events for longer than the
sandbox inactivity timeout even though the bridge remains healthy.
Previously, bridge heartbeats refreshed only heartbeat liveness, so the
lifecycle alarm could classify the sandbox as idle and stop it
mid-execution.

The sandbox event processor already owns which incoming events count as
activity. While a message is processing, a live bridge heartbeat now
renews the existing activity timestamp. After processing finishes,
heartbeats no longer renew activity and ordinary idle cleanup remains
unchanged.

This is a deliberately narrow alternative to ColeMurray#1601. It does not change
execution-timeout recovery, provider stop behavior, queue recovery,
schema, or cleanup semantics.

## Validation

- npm test -w @open-inspect/control-plane — 205 files, 3,188 tests
passed
- npm run test:integration -w @open-inspect/control-plane — 81 files,
1,002 tests passed
- npm run typecheck -w @open-inspect/control-plane
- npm run lint --workspace=@open-inspect/control-plane -- --no-fix
- Prettier check for all changed files
- git diff --check origin/main...HEAD

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

## Summary by CodeRabbit

* **Bug Fixes**
* Improved heartbeat tracking so idle heartbeats maintain liveness
without incorrectly extending activity timers.
* Heartbeats received while processing a message now correctly refresh
activity status.
  * Heartbeat events continue to be excluded from stored event history.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

Closes out the deps-style normalization campaign
(ColeMurray#1608/ColeMurray#1609/ColeMurray#1612/ColeMurray#1615/ColeMurray#1616): the last-resort `"main"` base-branch
fallback was written as a literal at seven independent sites. Per the
repo convention ("define each default value exactly once — extract to a
named constant and import everywhere"), it is now `DEFAULT_BASE_BRANCH`
in `src/repos/default-branch.ts`, imported at all seven.

Deferred from the ColeMurray#1608 review round.

## The seven sites

All express the same concept — the branch assumed only when neither the
caller nor the SCM provider's repository metadata supplies one;
configured per-repo defaults (ColeMurray#757) always win:

- `repos/resolve.ts` — `input.baseBranch?.trim() || access.defaultBranch
|| …`
- `automation/repository.ts` — same shape for automation repo selections
- `routes/session-child-spawn.ts` — spawn-context fallback
- `session/initialize.ts` and
`session/http/handlers/session-lifecycle.handler.ts` — init-payload
fallback
- `session/snapshot-reader.ts` and
`session/sandbox-lifecycle-adapters.ts` — legacy repository rows
persisted before `base_branch` was stored

Test fixtures keep their literals (they are inputs, not the default's
definition). No behavior change: the constant's value is `"main"`.

## Testing

- `npm run typecheck` (all three programs) clean; ESLint clean
- Unit + integration batteries green
- `rg '\?\? "main"|\|\| "main"' src` (non-test) → no matches


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

* **Bug Fixes**
* Standardized repository branch fallback behavior across session
initialization, automation, repository resolution, and child sessions.
* Repositories without a configured or provider-supplied base branch now
consistently use the default `main` branch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary
- keep directly automated and GitHub bot sessions hidden from the Mine
inbox
- allow user-attributed agent children with automation lineage to appear
as re-rooted Mine entries
- add integration coverage for an automation root with a user-attributed
child

## Root cause
The Mine inbox rejected every session with a non-null `automation_id`.
Child sessions inherit that ID from an automation parent, so even
children created after a user follow-up were filtered out.

## Verification
- `npm run test:integration -w @open-inspect/control-plane --
session-inbox.test.ts`
- `npm test -w @open-inspect/control-plane --
src/routes/session-index.test.ts src/db/session-index.test.ts`
- `npm run typecheck -w @open-inspect/control-plane`
- `npm run lint -w @open-inspect/control-plane`
- focused Prettier check
- `git diff --check`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/115a7540a10e9695039d22afac46028d)*

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

* **New Features**
* Updated the “Mine” inbox view to include agent sessions spawned from
automated sessions.
  * Clarified the option used to exclude automated sessions.

* **Bug Fixes**
* Improved inbox filtering so directly automated and GitHub Bot sessions
are excluded while eligible child sessions remain visible.

* **Tests**
* Expanded integration coverage for automated sessions, their child
sessions, and user-owned sessions in the “Mine” view.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary

- queues eligible GitHub PR comments and submitted reviews after signed
webhook validation
- re-reads authoritative GitHub state, correlates the owning session,
and applies repository policy
- records durable decisions and atomically admits one idempotent message
into the existing SessionDO queue
- enforces the rolling per-PR attempt cap and recovers ambiguous or
duplicate deliveries
- keeps Autofix default-off and preserves explicit mention behavior
- uses D1 migration 0058 without colliding with current main

## Stack

1. This PR: human and explicitly allowlisted review feedback foundation
2. ColeMurray#1183: producer-agnostic Open Inspect App reviews
3. ColeMurray#1184: configuration, timeline, queue health, and dogfood operations

## Validation

- all required GitHub checks pass
- full control-plane, web, bot, shared, Python, build, typecheck, lint,
format, integration, and Terraform validation jobs pass
- targeted D1 Autofix integration passes

## Rollout

Autofix remains disabled by default. This PR does not enable any
production repository.

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary

- accepts actionable submitted reviews authored by the exact configured
Open Inspect App login and Bot actor type
- keeps the dedicated Open Inspect review setting independent from
third-party bot allowlists
- rejects App-authored PR comments, approved reviews, empty reviews, and
matching human logins without normal write permission
- requires no producer-session metadata, publication receipt, special
sandbox tool, or reviewer prompt change

## Why

Autofix consumes authoritative GitHub reviews. Built-in review sessions
and custom automations can continue publishing reviews through their
existing GitHub mechanisms. Eligibility depends on the provider-read App
identity and repository setting, not on which Open Inspect workflow
produced the review.

## Stack

- Depends on ColeMurray#1182
- Base branch: pr-feedback-autofix-human
- Next: ColeMurray#1184 configuration, timeline, queue health, and dogfood
operations

## Validation

- repository typecheck, lint, and format check
- full affected shared, control-plane, GitHub bot, and web suites
- focused own-App eligibility and ingress tests
- targeted D1 Autofix integration
- Terraform format check

## Rollout

Open Inspect review Autofix remains disabled by default. Existing review
producers require no change.

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

## Summary by CodeRabbit

* **New Features**
* Improved pull request feedback processing to recognize authoritative
reviews from the configured Open Inspect app.
* Actionable reviews can now be queued without an additional permission
check.
  * Inline-only review comments are supported.

* **Bug Fixes**
* Improved filtering for unauthorized bots, bot comments, disabled
review handling, non-actionable reviews, and reviewers without write
permission.
  * Removed an incorrect attribution-based rejection case.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary

- adds global and repository-override Autofix settings with default-off
behavior
- explains that exact Open Inspect App reviews are eligible regardless
of producer workflow
- warns operators before trusting third-party bot input or raising
attempt limits
- labels admitted feedback with the existing generic review origin in
the session timeline
- adds primary Queue and DLQ health inspection without delaying
scheduled work
- documents producer-neutral dogfood, triage, and kill-switch procedures
- makes warranted originating-PR outcome responses explicit

## Stack

- Depends on ColeMurray#1183
- Base branch: pr-feedback-autofix-open-inspect-review
- Final PR in the stack

## Validation

- all required GitHub checks pass
- full control-plane, web, bot, shared, Python, build, typecheck, lint,
format, integration, and Terraform validation jobs pass
- independent thermo review and closure re-review pass
- independent revised-plan adherence review passes with no deviations

## Dogfood gates

This PR does not enable a repository. Before dogfood:

- configure external alert routing for Queue and DLQ health events
- exercise both the built-in reviewer and an existing custom review
automation
- verify duplicate delivery, timeline provenance, and attempt-cap
behavior
- explicitly accept the absence of an authoritative spend budget or add
that platform capability first

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

## Summary by CodeRabbit

* **New Features**
* Added GitHub PR feedback Autofix settings, including review/comment
triggers, approved bot accounts, and attempt limits.
  * Added per-repository Autofix overrides.
* Session timelines now show whether work resumed from a human or bot
comment/review, with a link to the feedback.
  * GitHub avatars now use stable profile images.
* **Bug Fixes**
  * Improved Autofix queue monitoring and operational alerts.
* **Documentation**
  * Added a rollout and troubleshooting runbook for PR Feedback Autofix.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary
- replace the generic `create-pull-request` argument/output disclosure
with the selected pull request preview treatment
- render agent-authored PR bodies as sanitized Markdown without assuming
Summary or Verification sections
- parse current created, updated, draft, manual, pending, and failure
output variants while preserving unknown output verbatim
- validate external PR links and keep long descriptions progressively
disclosed
- add focused coverage for rendering, lifecycle states, unsafe URLs,
arbitrary body formats, and case-insensitive tool dispatch

## Verification
- `npm test -w @open-inspect/web --
src/components/create-pull-request-event.test.tsx
src/components/tool-call-item.test.tsx`
- `npm run lint -w @open-inspect/web`
- `npm run typecheck -w @open-inspect/web`
- `git diff --check`

## Testing note
- the full web suite completed all 1,226 assertions successfully, but
Vitest exited nonzero because the pre-existing
`sandbox-settings.test.tsx` timeout callback fired after jsdom teardown
(`window is not defined`)

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/6e4947f5c6a40da91e6ca16c2823cbb7)*

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

* **New Features**
* Added rich pull-request timeline events for creation, updates, drafts,
pending states, failures, and manual creation.
* Added expandable descriptions with Markdown support, branch details,
links, and status indicators.
* Added safe handling for external links and unrecognized pull-request
output.

* **Bug Fixes**
* Pull-request tool calls now consistently use the specialized display,
including mixed-case names.

* **Tests**
* Added comprehensive coverage for pull-request states, expansion
behavior, link safety, and fallback rendering.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary

- replace the Autofix session HTTP handler factory with a class
- inject `SessionAutofixService` directly through the constructor
- update session composition and handler tests to use the class API
- preserve the existing route adapter, validation, logging, and response
behavior

## Context

This aligns the Autofix endpoint with the class-based session HTTP
handler pattern established in ColeMurray#1612.

## TDD

- changed the handler test to instantiate `AutofixHandler`, confirming
the red state with `AutofixHandler is not a constructor`
- implemented the class and reran the focused test to green

## Validation

- `npm run build -w @open-inspect/shared`
- focused Autofix handler tests: 2 passed
- `npm test -w @open-inspect/control-plane`: 3,253 passed
- `npm run test:integration -w @open-inspect/control-plane`: 1,006
passed
- `npm run typecheck -w @open-inspect/control-plane`
- `npm run lint -w @open-inspect/control-plane`
- targeted Prettier check
- `npm run build -w @open-inspect/control-plane`
- `git diff --check`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/a531a7ca7d9557ead0ead1e406f70652)*

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

## Summary by CodeRabbit

* **Bug Fixes**
* Maintained autofix request handling, validation, error responses, and
service dispatch behavior.
* Updated internal handler wiring without changing the user-visible
autofix experience.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
…urray#1620)

## Summary

- replace `Response` return values from Scheduler tick, event, manual
trigger, run completion, and health operations with operation-specific
typed results
- remove the synthetic `Scheduler.dispatch()` HTTP router after
confirming it had no production callers
- serialize Scheduler outcomes only in the real automation and webhook
HTTP adapters while preserving their status codes and JSON bodies
- make in-process automation completion acknowledgement and retryable
failure outcomes explicit, retaining the existing two-attempt retry
policy without interpreting HTTP statuses
- update Scheduler unit and integration tests to invoke typed
application methods directly, while retaining route/webhook HTTP
contract coverage

## External Contract Preservation

- manual trigger success remains `201` with `{ invocationId, runs }`
- active manual runs remain `409` with `{ error: "A run is already
active for this automation" }`
- trigger launch failures and authoritative lookup/validation failures
remain wrapped as `500` by the public route
- normalized event, generic automation webhook, and Sentry webhook
success bodies remain `{ ok: true, triggered, skipped, steered }`
- event forwarding exceptions remain `502` at the normalized event
adapter
- request validation and authentication continue to run before Scheduler
invocation

## Completion And Retry Behavior

- completed and ignored run callbacks are explicit acknowledged outcomes
- invalid callback input is an explicit retryable Scheduler failure,
preserving the previous behavior where the callback service retried a
non-2xx Scheduler response
- thrown D1/application failures still retry once and remain distinct
from typed Scheduler rejections
- completion remains best-effort after both attempts, matching existing
notification behavior

## Dispatch Removal Evidence

Repository-wide call inspection found `Scheduler.dispatch()` only in
Scheduler unit/integration test shims. Production invokes `tick()`,
`event()`, `trigger()`, and `runComplete()` directly, and there is no
external Scheduler service or Durable Object binding. The fake router
and its unknown-route tests were therefore removed rather than retained
as a compatibility layer.

## Verification

- `npm test -w @open-inspect/control-plane --
src/scheduler/scheduler.test.ts src/routes/automations.test.ts
src/session/callback-notification-service.test.ts
src/webhooks/automation-event.test.ts
src/webhooks/automation-webhook.test.ts` (229 tests)
- `npm run test:integration -w @open-inspect/control-plane --
test/integration/scheduler.test.ts
test/integration/scheduler-events.test.ts
test/integration/scheduler-slack-events.test.ts
test/integration/webhooks.test.ts
test/integration/webhooks-slack.test.ts
test/integration/webhooks-github-pr-lifecycle.test.ts` (85 tests)
- `npm run typecheck -w @open-inspect/control-plane`
- `npm run lint -w @open-inspect/control-plane`
- `npm run build -w @open-inspect/control-plane`
- code-simplifier review completed; no generic result framework or
compatibility adapter was introduced

## Migration Impact

No database, shared-package, deployment, or external API migration is
required. This is an internal control-plane application boundary change;
direct TypeScript callers now consume discriminated results instead of
decoding synthetic HTTP responses.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/2576829fb50115431a5a2451edc7128f)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary

- replace the storage-shaped image-build status DTO with a camelCase
public API contract
- expose `repositoryShas` as validated `RepositoryShaEntry[] | null`
instead of leaking the D1 JSON string
- keep snake_case rows and `repository_shas` internal to control-plane
persistence
- decode each status row once at the control-plane response boundary and
map malformed historical provenance to `null`
- move the canonical repository provenance Zod schemas into
`@open-inspect/shared` and reuse them for callback and stored-row
validation
- remove the web JSON parser and consume typed provenance directly while
preserving status folding, fingerprint filtering, primary SHA display,
and duration formatting

## HTTP Contract

Image-build status records now use public camelCase names, including
`scopeKind`, `scopeId`, `repositoriesFingerprint`, `runtimeVersion`,
`buildDurationSeconds`, `errorMessage`, and `createdAt`.
`repositoryShas` is a decoded array or `null`; `repository_shas` and all
other D1 encodings are no longer exposed.

Malformed historical `repository_shas` values do not fail the status
feed. They map to `repositoryShas: null`. Internal rebuild and
finalization paths continue reading the raw row and retain their
existing invalid-provenance behavior.

## TDD Evidence

### Red

Tests were changed before production code and produced the expected
failures:

- shared DTO tests rejected the new camelCase structured record and
`repositoryShaEntrySchema` was not exported
- the control-plane mapper test failed because `status-view` did not
exist
- status integration tests observed snake_case keys, a JSON-encoded
`repository_shas`, and no nullable decoded field
- web folding returned no statuses because it still read snake_case
fields
- primary SHA extraction returned `null` because it still expected a
JSON string

### Green

The minimum implementation added the shared schema, internal storage-row
type, one response mapper, and typed web consumption. Focused shared,
control-plane, integration, and web tests then passed.

### Refactor

After green, the code-simplifier pass removed a duplicate inherited
storage field and consolidated imports. The focused suites remained
green.

## Compatibility

All in-repo HTTP consumers are updated atomically in this monorepo. No
temporary dual-field response is included: retaining `repository_shas`
would continue exposing the storage encoding and conflict with the A03
contract, while there is no external consumer evidence requiring it.
Shared-package changes trigger both affected deployment paths; a brief
mixed-version rolling window remains the normal risk for this
intentional contract change, but adding a second wire shape would not
eliminate that risk without preserving the deprecated leak.

## Validation

- `npm run build -w @open-inspect/shared`
- shared tests: 50 files, 697 tests passed
- control-plane unit tests: 213 files, 3,257 tests passed
- control-plane `image-builds.test.ts` integration: 51 tests passed
- web tests: 163 files, 1,231 tests passed
- `npm run typecheck`
- ESLint on all changed files
- Prettier check on all changed files
- `git diff --check`

The first parallel full web run had two unrelated ESLint-boundary test
timeouts under concurrent load; the isolated full web rerun passed all
1,231 tests. Repository-wide `npm run lint` and `npm run format:check`
remain blocked by pre-existing, untouched `.opencode` lint errors and
`.opencode/package.json` formatting drift; all changed files pass both
checks.

## Migration And Risk

- no D1 schema or data migration is required
- malformed persisted provenance is represented safely only at the
public response boundary
- no image callback lifecycle or provider behavior was refactored
- the intentional HTTP DTO change is the primary compatibility risk

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/529a68bb06a61cfc493c4f4414bee068)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
…y#1625)

## Summary

- remove `SessionAutofixService`, which only forwarded two commands to
`SessionMessageQueue`
- give `AutofixHandler` a consumer-owned two-method queue surface
- dispatch admission and recovery commands directly at the validated
HTTP boundary
- move both dispatch cases into the handler test and delete the
duplicate service suite

## Context

This addresses the second Autofix refactor finding after ColeMurray#1624: the
session path no longer inserts a behavior-free service between the HTTP
handler and message queue.

## TDD

- changed the handler tests to inject queue capabilities directly and
added recovery lookup coverage
- confirmed the red state for both valid command variants at the old
`service.handle` seam
- removed the service and implemented direct narrow-port dispatch

## Validation

- `npm run build -w @open-inspect/shared`
- focused Autofix handler tests: 3 passed
- `npm test -w @open-inspect/control-plane`: 3,252 passed
- `npm run test:integration -w @open-inspect/control-plane`: 1,006
passed
- `npm run typecheck -w @open-inspect/control-plane`
- `npm run lint -w @open-inspect/control-plane`
- targeted Prettier check
- `npm run build -w @open-inspect/control-plane`
- `git diff --check`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/a531a7ca7d9557ead0ead1e406f70652)*

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

* **Bug Fixes**
* Autofix requests now correctly enqueue new feedback and retrieve
results for recovery lookups.
* Invalid autofix commands continue to return a validation error without
triggering queue operations.
* Autofix responses now consistently reflect whether feedback was
accepted, duplicated, rejected, found, or unavailable.

* **Tests**
* Expanded coverage for feedback enqueueing, recovery lookups,
invalid-command handling, and response outcomes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary
- exclude the session-injected `.opencode` directory from the root
ESLint scan
- keep generated local tooling from producing environment-specific
`no-undef` and unused-variable failures

## Verification
- `npm run lint`
- `npx prettier --check eslint.config.js`
- `git diff --check`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/b34c42382069ae3b2941c82dc52bbe17)*

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

* **Chores**
  * Improved linting coverage for OpenCode configuration and scripts.
* Updated lint checks to recognize Node.js environments and handle
intentionally unused parameters consistently.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
…eMurray#1629)

Phase B of the collaborator-arity program:
`SessionSandboxEventProcessor` was a 19-parameter dispatch table — 13+
event types, each branch using a different collaborator subset. This
splits it into a thin router plus per-family handlers, mirroring the
HTTP-route decomposition. Behavior-preserving: the existing
`sandbox-events` suite (37 tests) passes with **zero assertion changes**
— only the construction helper changed, and it now builds the real
family composition.

## Shape

`src/session/sandbox-events/`:

| Class | Params | Owns |
| --- | --- | --- |
| `SessionSandboxEventProcessor` (router) | 8 | arrival logging,
per-event context (one `Date.now()`, one message-attribution
resolution), dispatch, **the ack contract** |
| `SandboxStreamingEventHandler` | 6 | `token`, `context_compacted`,
`step_start`/`step_finish`, `tool_call` + the generic timeline path
(`tool_result`, `error`, `warning`, `user_message`, unknown) |
| `SandboxArtifactEventHandler` | 4 | `artifact` |
| `SandboxExecutionEventHandler` | 12 | `execution_complete` — the
settle-a-turn convergence point |
| `SandboxRuntimeEventHandler` | 7 | `heartbeat`, `session_title`,
`ready`, `git_sync` |
| `SandboxPushCoordinator` | 4 + resolver state | `pushBranchToRemote`
and `push_complete`/`push_error` — one unit, because the terminal events
settle state the request side created |

The ack contract is now a single post-dispatch line in the router;
family handlers never see `ackId`. Ack ordering is unchanged — critical
events ack after their handler finishes, exactly where the old branches
acked (`execution_complete` after `processMessageQueue`, push/tail
events after broadcast).

The execution handler is deliberately still wide (12): every param is a
distinct role in settling a finished turn. The status-owner campaign is
expected to absorb `projectTerminalMessage` and parts of `statusService`
into one projection surface; the class doc says to re-measure then
rather than split further now.

## Inventory findings (charted before cutting)

- `error` and `snapshot_ready` had no dedicated branches — the old
fall-through tail was really a *timeline-observer* path (persist →
broadcast → ack-if-critical). That path is now `recordTimelineEvent` on
the streaming handler, with the router's `default` case routing to it.
- `ready` did its side effects early and then **fell through** to the
tail (persist + broadcast). It's now fully owned by the runtime handler
with the same effect order.
- `snapshot_ready` in `CRITICAL_EVENT_TYPES` is unreachable: it's not in
the `sandboxEventSchema` union (both entry paths validate against it)
and the Modal bridge never emits it. Left inert here — flagging for a
separate cleanup rather than changing semantics in a refactor.

One non-observable ordering note: the router computes context (two pure
reads) before dispatch, so for `ready` the `getProcessingMessage` read
now precedes `pinBaselines` instead of following it; the two touch
disjoint state.

## Verification

- `tsc` ×3 programs (src, test, integration) clean; ESLint clean
- Unit battery 3253/3253; integration battery 1006/1006 (includes
`session-do-collaborator-wiring.test.ts`, which patches
`pushBranchToRemote` through the DO — the router keeps that method as a
delegate to the coordinator so the seam still intercepts)


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

* **Improvements**
* Improved processing of sandbox activity, including streaming updates,
artifacts, runtime events, and execution completion.
* Improved reliability of branch push operations, including completion
tracking, error handling, timeouts, and support for multiple pending
pushes.
  * Preserved delivery acknowledgements for critical sandbox events.
* **Bug Fixes**
* Improved session activity, status updates, notifications, and timeline
synchronization during sandbox operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

- add strict Pydantic request models for interactive sandbox create and
snapshot restore
- validate repository owner/name pairs and nested multi-repository
identities at the HTTP boundary
- parse create/restore requests once and construct manager inputs from
typed values
- centralize authentication, timing, HTTP exception tracking, generic
exception mapping, and `modal.http_request` logging in a small async
context manager
- map unexpected internal failures to sanitized HTTP 500 responses
instead of HTTP 200 `{ success: false }` payloads
- preserve explicit build-session not-found handling and all
endpoint-specific success response shapes

## Compatibility

The existing rolling-deployment policy is preserved independently from
strict field typing:

- unknown top-level request fields remain ignored through
`_ModalRequestModel` (`extra="ignore"`)
- unknown nested restore `session_config` fields remain preserved
(`extra="allow"`) so snapshots can round-trip fields introduced by newer
control-plane deployments
- known fields use strict types, so values such as `"false"` are
rejected rather than coerced to truthy booleans
- optional no-repository sessions remain supported, while partial
repository identities are rejected
- default timeout and VNC behavior, repo-image create behavior, snapshot
clone-token compatibility, environment variables, settings,
code-server/VNC/Slack flags, multi-repository session configuration, and
structured correlation IDs are preserved

No control-plane changes were necessary. Its Modal client already
handles non-2xx responses explicitly, and successful response payloads
are unchanged.

## Error Envelope

The shared endpoint execution seam owns:

- bearer authentication before request and control-plane URL validation
- request timing and success/error outcome tracking
- propagation of known `HTTPException` status/detail values
- logging unexpected exceptions server-side and mapping them to bounded
`500 Internal server error` responses
- final `modal.http_request` logging, including endpoint-specific
trace/request/session/sandbox/build identifiers

Control-plane URL validation no longer reflects the submitted URL in
client-visible errors.

## TDD Evidence

Red:

- added focused tests before production changes
- initial focused run: `11 failed, 30 passed`
- expected failures showed string booleans being accepted, malformed
typed fields reaching Modal/domain code, and generic create/restore
failures returning normally instead of raising HTTP 500

Green:

- added the create/restore request models and applied the minimal
execution seam to those handlers
- focused create/restore run: `41 passed`

Refactor:

- extracted all remaining authenticated endpoint envelopes onto the
tested seam
- combined focused create/build API run after extraction: `74 passed`
- applied the code-simplifier review and removed only redundant
execution-path state and an unreachable error mapping
- reran focused and full verification after refactoring

## Verification

- `uv run pytest tests/test_web_api_create_sandbox.py
tests/test_web_api_build_sandbox.py -q` -> 74 passed
- `uv run pytest tests/ -q` -> 210 passed
- `uv run ruff check src/web_api.py
tests/test_web_api_create_sandbox.py` -> passed
- `uv run ruff format --check src/web_api.py
tests/test_web_api_create_sandbox.py` -> passed
- `git diff --check` -> passed

An additional `uv run mypy src/web_api.py` was attempted and reports 16
existing strict-typing issues in this legacy module, primarily
pre-existing unparameterized endpoint `dict` annotations and dynamically
re-exported constants. This check is not part of the requested Modal
validation set and no new mypy-specific scope was added.

## Risks

- malformed create/restore payloads that previously reached domain code
or were silently coerced now receive HTTP 400 errors
- unexpected failures now correctly produce non-2xx responses; callers
relying on the erroneous HTTP-200 error object behavior will observe the
corrected contract
- unknown-field handling remains intentionally permissive for rolling
deployments as described above

## Scope

This change is limited to audit finding A21. It does not include A22's
`SandboxProvider` capability/launch-contract refactor, provider adapter
consolidation, or image-build lifecycle changes.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/14275a8cddd1b305bd607af44c6f6ba0)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
…ound the request (ColeMurray#1408)

## Problem

The Slack and Linear bots classify each inbound message to decide which
repository or environment a coding session should target. Both
classifiers are pinned to Anthropic:

- `packages/slack-bot/src/classifier/index.ts` builds an Anthropic
client and forces a `classify_target` tool call.
- `packages/linear-bot/src/classifier/index.ts` calls
`api.anthropic.com/v1/messages` directly and **hardcodes**
`claude-haiku-4-5` with no env override at all.

Two consequences:

1. **Single-provider coupling.** An Anthropic outage, rate limit, or
billing lapse degrades routing on every deployment, with no way to point
the classifier elsewhere — even for deployments whose coding agents
already run OpenAI models. We hit exactly this: an Anthropic billing
lapse dropped both bots to "pick a target yourself" until it was
noticed.
2. **Unbounded requests.** Neither classifier passes an abort signal, so
a stalled or queued provider request holds the Slack thread / Linear
webhook open until the platform kills the invocation. The classifiers
already fail soft to a target picker, so a *fast* failure is cheap — it
was the unbounded wait that hurt.

## What this does

Lets an operator pick the classifier's provider, requires **only that
provider's** credential, and binds exactly one provider key to the bots.

| `classification_model` | Provider | Credential required |
|---|---|---|
| `anthropic/<x>` or bare `claude-*` (default) | Anthropic, existing
tool-calling request | `classification_anthropic_api_key`, falling back
to `anthropic_api_key` |
| `openai/<x>` or bare `gpt-*` | OpenAI Chat Completions, strict
`json_schema` | `classification_openai_api_key` |

The prefix rule reuses the convention already encoded in
`normalizeModelId`/`MODEL_CATALOG` in `packages/shared/src/models.ts`,
so there is no second setting that can disagree with the model id. The
bare id is sent to the provider. An unrecognised prefix throws into each
classifier's existing `catch`, which already degrades to asking the user
to pick — no new failure mode.

Both providers funnel through the existing validators
(`normalizeModelResponse` in slack-bot, `classifyToolInputSchema` in
linear-bot), so the downstream contract is untouched.

`CLASSIFICATION_REQUEST_TIMEOUT_MS = 15_000` now bounds **both**
providers, following the existing convention (`REPOS_FETCH_TIMEOUT_MS`,
`OUTBOUND_REQUEST_TIMEOUT_MS`): milliseconds in the name, defined once,
and asserted in tests by identity of the signal object rather than just
its shape.

### Scope of the credential choice — please read

This is deliberately **classifier-scoped**, not a deployment-wide
provider switch. `anthropic_api_key` is left exactly as it is on `main`
(`nullable = false`, non-blank validation) because it has consumers
unrelated to classification: the Modal sandbox's `llm-api-keys` secret
(`modal.tf`) that Claude coding sessions use, and the opencomputer
control-plane path. The diff to `variables.tf` is purely additive — it
does not touch that variable.

So: choosing the OpenAI classifier means you supply
`classification_openai_api_key` and the bots receive **only** that key.
It does not make the deployment OpenAI-only, and this PR makes no claim
to. Making sandbox provider credentials uniformly optional is a
separate, larger change tied to the default coding model, and I have not
attempted it here.

## Backward compatibility

**Nothing changes for an existing deployment that sets no new value.**

- `classification_model` defaults to `claude-haiku-4-5` — today's value.
- `classification_anthropic_api_key` defaults to blank and falls back to
`anthropic_api_key`, so existing deployments keep working untouched.
- The Anthropic request body is unchanged; the timeout is passed as
`messages.create(body, { signal })`, so the body itself is untouched.
- `ANTHROPIC_API_KEY` stays required, the `@anthropic-ai/sdk` dependency
stays, `CLASSIFY_TARGET_TOOL` stays.
- No Claude entries removed anywhere —
`packages/linear-bot/src/model-resolution.ts` (`MODEL_LABEL_MAP`) is
untouched, so `model:opus`-style Linear labels keep working.
- Anthropic-classifier deployments keep exactly the bot secret bindings
they had; no empty secret is introduced and no worker version churns
from this change.
- The Anthropic SDK client is now constructed lazily, so an
OpenAI-configured deployment never reaches `new Anthropic({ apiKey:
undefined })`.

The Linear bot gains a `CLASSIFICATION_MODEL` binding it never had; its
default makes the previously hardcoded `claude-haiku-4-5` explicit, so
the effective model is unchanged.

## Configuration

```hcl
# Default — Anthropic, using the key you already supply
# classification_model = "claude-haiku-4-5"

# Or classify on OpenAI; the bots then receive only this key
classification_model          = "gpt-5.4-mini"
classification_openai_api_key = "sk-proj-..."
```

Each provider's key is validated non-blank **when that provider is
selected and a classifier bot is enabled** — so an OpenAI deployment is
never asked for an Anthropic classifier key, a deployment running
neither bot is never asked for either, and a selected provider can't
ship credential-less. That last guard matters because GitHub Actions
renders an unset secret as an empty string, which would otherwise plan
and apply cleanly and leave a classifier rejecting every message. For
the same reason the workflow maps the model with an explicit fallback
(`${{ vars.CLASSIFICATION_MODEL || 'claude-haiku-4-5' }}`, matching the
existing `ENABLE_SLACK_BOT || 'true'` pattern), and the configuration
additionally refuses a blank override rather than silently treating it
as "use the default".

## Verification

Terraform (`terraform test`, mock providers) — **18 passed, 0 failed**,
including a new `tests/classifier_provider.tftest.hcl` whose 8 runs
cover every branch:

- Anthropic default binds `ANTHROPIC_API_KEY` and **no**
`OPENAI_API_KEY` on both bots (the backward-compatibility guarantee,
asserted rather than assumed)
- OpenAI model binds `OPENAI_API_KEY` and **no** `ANTHROPIC_API_KEY` —
exactly one provider credential reaches the bots, asserted in both
polarities
- `gpt-5.4-mini` and `openai/gpt-5.4-mini` both resolve to OpenAI;
`anthropic/claude-haiku-4-5` resolves to Anthropic
- OpenAI model with a blank key → plan **fails**
- OpenAI model with both bots disabled and a blank key → plan
**succeeds**
- unknown provider prefix → plan **fails**; blank model → plan **fails**

The pre-existing `anthropic_api_key_blank` guard in
`tests/auth_provider_configuration.tftest.hcl` still passes unchanged.
`terraform fmt -check -recursive` clean; `terraform validate` success.

TypeScript: `npm run typecheck` exit 0; `eslint --max-warnings 0` clean
on both changed packages.

Unit suites (clean upstream-main baseline → this branch): slack-bot 421
→ **425**, linear-bot 223 → **230**; unchanged elsewhere: shared
**601**, github-bot **130**, control-plane **2518**, web **956**.
Control-plane integration (workerd + real D1): **778 passed**.

New tests per bot cover: the OpenAI request contract
(`max_completion_tokens` present, `max_tokens` absent, `temperature: 0`,
`strict: true`, bare model id, `additionalProperties: false`, all fields
`required`, nullable id typed `["string","null"]`), non-2xx degrading to
the picker, the timeout signal being the exact `AbortSignal.timeout`
object, the Anthropic default path still firing when nothing is set, and
an unrecognised prefix degrading without calling either provider.

## Notes for reviewers

- **`max_completion_tokens` is required and `max_tokens` is rejected**
by the gpt-5 family (`Unsupported parameter: 'max_tokens' is not
supported with this model`) — verified against the live API, and pinned
by a test in each bot so it cannot regress silently.
- Each bot implements its own small OpenAI request function rather than
sharing one: two call sites with different schemas, and it keeps each
Worker self-contained. Happy to extract into `packages/shared` if you
would prefer that.
- The provider is derived from the model id rather than a separate
`CLASSIFICATION_PROVIDER` variable, to avoid a setting that can disagree
with the model. If you would rather support OpenAI-compatible gateways
(Azure, OpenRouter, proxies) whose ids are not `gpt-*`, an explicit
provider override is the natural follow-up — happy to add it here or
later.
- `classification_anthropic_api_key` exists mainly so the two providers
are symmetric and the classifier's credential is separable from the
sandbox's. If you would rather the Anthropic classifier just always read
`anthropic_api_key` and drop that variable, that is a one-line
simplification — say which you prefer.
- The `docs/GETTING_STARTED.md` diff looks larger than it is: adding
`CLASSIFICATION_ANTHROPIC_API_KEY` widened the Actions-secret table's
first column, so Prettier (which your `lint-staged` runs on Markdown)
realigned every row. `git diff -w` on that file shows only the six
sample lines, the two new table rows, and the widened separator.


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

* **New Features**
* Added configurable classification model selection for Slack and Linear
bots.
* Added OpenAI and Anthropic classification support with
provider-specific credentials.
  * Added structured response validation and 15-second request timeouts.
* Added graceful handling for unsupported models, provider errors, and
missing credentials.

* **Documentation**
  * Updated setup and deployment guidance for models and API keys.

* **Tests**
* Expanded coverage for provider selection, validation, timeouts,
credentials, and fallback behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
)

This is an automated nightly unsafe-cast remediation sweep. It fixes
three current default-branch findings by replacing unsafe
boundary/persisted-data assertions with Zod parsing or existing schema
parsing, following the TypeScript Coding Standards unsafe-cast /
parse-don't-assert guidance and the Zod boundary-validation pattern
established in PR ColeMurray#807.

| file:line | risk | cast removed | fix |
| --- | --- | --- | --- |
| `packages/slack-bot/src/classifier/index.ts:141` / `:152` / `:175` |
High | External LLM tool payload cast to `Record<string, unknown>` and
confidence cast to `ClassificationResult["confidence"]` | Added local
`llmResponseSchema` and `safeParse` at the model-output boundary;
invalid output preserves the existing low-confidence clarification
fallback. |
| `packages/control-plane/src/db/automation-model-provider-auth.ts:30` |
High | Persisted provider auth rows assembled and cast to
`ModelProviderSelections`, bypassing existing schema | Runs
`modelProviderSelectionsSchema.parse` after row assembly so the shared
Zod schema remains the source of truth. |
| `packages/control-plane/src/db/mcp-servers.ts:66`, `:79`, `:94`,
`:237` | Medium | Persisted MCP JSON/type fields cast to `Record<string,
string>` and `"local" | "remote"` | Added package-local Zod parsers for
MCP server type, command arrays, and env/header maps at D1 decode sites.
|

Verification:

| command | result |
| --- | --- |
| `npm run build -w @open-inspect/shared` | Passed |
| `npm run build -w @open-inspect/control-plane` | Passed |
| `npm run build -w @open-inspect/slack-bot` | Passed |
| `npm run typecheck` | Passed |
| `npm run format` | Passed |
| `npm run lint -w @open-inspect/control-plane` | Passed |
| `npm run lint -w @open-inspect/slack-bot` | Passed |
| `npm test -w @open-inspect/control-plane` | Passed |
| `npm test -w @open-inspect/slack-bot` | Passed |
| `npm run lint` | Failed on pre-existing `.opencode/**/*.js` `no-undef`
errors outside this sweep's allowed touch set; package lint for changed
code passed. |


---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/c7e806bd601ed64888d77b3ed7ec687e)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
This is an automated nightly unsafe-cast remediation sweep. It replaces
selected unsafe TypeScript casts at boundary/persisted-data sites with
parse-don't-assert validation, following the TypeScript Coding Standards
unsafe-cast guidance and the Zod boundary-validation pattern established
in PR ColeMurray#807.

| Finding | Risk | Cast removed | Fix |
| --- | --- | --- | --- |
| `packages/slack-bot/src/classifier/repos.ts:224` | HIGH | KV fallback
`cached as SlackRoutingRule[]`, bypassing the existing shared
routing-rule schema | Uses
`z.array(slackRoutingRuleSchema).safeParse(cached)` before
`normalizeRoutingRules`; malformed cached routing rules fail open to the
existing empty fallback. |
| `packages/control-plane/src/session/event-stream.ts:119` | MEDIUM |
persisted event `JSON.parse(event.data) as Record<string, unknown>` |
Adds a local Zod `persistedEventDataSchema` and validates parsed event
data before returning the HTTP event response. |
| `packages/control-plane/src/routes/session-children.ts:127` | LOW |
child response `(await response.clone().json()) as { messageId?: unknown
}` | Replaces the assertion with a plain object/property guard;
malformed best-effort response payloads continue to be ignored. |

Verification:

| Command | Result |
| --- | --- |
| `npm run format` | Passed |
| `npm test -w @open-inspect/control-plane --
src/session/event-stream.test.ts src/routes/session-children.test.ts` |
Passed, 2 files / 19 tests |
| `npm test -w @open-inspect/slack-bot -- src/classifier/repos.test.ts`
| Passed, 1 file / 23 tests |
| `npm run build -w @open-inspect/shared` | Passed |
| `npm run build -w @open-inspect/control-plane` | Passed |
| `npm run build -w @open-inspect/slack-bot` | Passed |
| `npm test -w @open-inspect/control-plane` | Passed, 168 files / 2568
tests |
| `npm test -w @open-inspect/slack-bot` | Passed, 34 files / 423 tests |
| `npm run typecheck` | Passed |
| `npm run lint -w @open-inspect/control-plane` | Passed |
| `npm run lint -w @open-inspect/slack-bot` | Passed |
| `git diff --check` | Passed |
| `npm run lint` | Failed on pre-existing `.opencode/` helper files
(`no-undef` for `process`, `fetch`, `Headers`, `URL`, etc.), unrelated
to the files touched by this sweep. |

Reference: TypeScript Coding Standards unsafe-cast / parse-don't-assert
guidance and the Zod webhook normalizer pattern from PR ColeMurray#807.


---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/db6e4a50d71c0639ad6c7d522af6683f)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
This is an automated nightly unsafe-cast remediation sweep. It replaces
qualifying unsafe TypeScript assertions at trust boundaries with
parse-don't-assert style guards, following the TypeScript Coding
Standards for unsafe casts and the Zod boundary-validation pattern
established in PR ColeMurray#807. This PR is draft because the exact root `npm run
lint` gate fails in this sandbox on untracked local `.opencode/` tooling
files outside the repository-tracked source changes.

| Finding | Risk | Cast Removed | Fix |
| --- | --- | --- | --- |
| `packages/control-plane/src/sandbox/e2b-rest-client.ts:183` | High |
External E2B Connect end-stream body cast to `{ error?: { message?:
string } }` | Inline `isRecord` guard before reading `error.message` |
| `packages/control-plane/src/sandbox/e2b-rest-client.ts:190` | High |
External E2B Connect event body cast to `{ event?: Record<string, {
status?: string }> }` | Inline `isRecord` guards before reading
`event.end.status` |
| `packages/control-plane/src/webhooks/automation-event.ts:56` and `:83`
| High | Normalized webhook envelope body cast to `Record<string,
unknown>` before schema validation | Inline `isRecord` guard before
source/eventType reads; existing `automationEventSchema.safeParse`
remains authoritative |
| `packages/web/src/app/api/sessions/[id]/title/parse-request.ts:4` |
Medium | Request body cast to `{ title?: unknown }` | Existing object
guard plus `"title" in body` one-field access |

Verification:

| Command | Result |
| --- | --- |
| `npm run build -w @open-inspect/shared` | Passed |
| `npm run build -w @open-inspect/control-plane` | Passed |
| `NODE_ENV=production npm run build -w @open-inspect/web` | Passed |
| `npm run typecheck` | Passed |
| `npm run format` | Passed |
| `npm test -w @open-inspect/control-plane` | Passed: 204 files, 3184
tests |
| `npm test -w @open-inspect/web --
src/app/api/sessions/[id]/title/route.test.ts` | Passed: 1 file, 3 tests
|
| `npm test -w @open-inspect/web` | Passed on retry: 162 files, 1214
tests |
| `npm run lint -w @open-inspect/control-plane && npm run lint -w
@open-inspect/web` | Passed |
| `npm run lint` | Failed: ESLint includes untracked local `.opencode/`
tooling files with `no-undef` errors; none are tracked or modified by
this PR |

Notes:

- The first `npm run build -w @open-inspect/web` failed with this
sandbox's non-standard `NODE_ENV`; rerunning with `NODE_ENV=production`
passed.
- No dependencies were added.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/84e35873f963231ea86abe832d6fc1bb)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
This is an automated nightly unsafe-cast remediation sweep. It replaces
three unsafe casts of opaque SQLite PRAGMA rows with a local parse/guard
path, following the TypeScript Coding Standards for unsafe casts and
parse-don't-assert. The selected boundary is package-local and trivial,
so this uses inline runtime guards instead of Zod; this is consistent
with the Zod boundary-validation pattern established in PR ColeMurray#807 for
structured external payloads while keeping one-field SQLite row parsing
minimal.

| Finding | Risk | Cast removed | Fix |
| --- | --- | --- | --- |
| `packages/control-plane/src/session/schema.ts:386` | Medium | `PRAGMA
table_info(participants).toArray() as Array<{ name: string }>` | Inline
`isRecord`/`parseSqlColumnNames` guard before building the column set |
| `packages/control-plane/src/session/schema.ts:422` | Medium | `PRAGMA
table_info(${table}).toArray() as Array<{ name: string }>` | Inline
`isRecord`/`parseSqlColumnNames` guard before checking for
`scm_provider` |
| `packages/control-plane/src/session/schema.ts:436` | Medium | `PRAGMA
table_info(session).toArray() as Array<{ name: string }>` | Inline
`isRecord`/`parseSqlColumnNames` guard before building the column set |

Verification:

| Command | Result |
| --- | --- |
| `npm run build -w @open-inspect/shared` | Passed |
| `npm run build -w @open-inspect/control-plane` | Passed |
| `npm run typecheck` | Passed |
| `npm run format` | Passed, no additional changes |
| `npm run lint -w @open-inspect/control-plane` | Passed |
| `npm test -w @open-inspect/control-plane` | Passed, 203 files / 3167
tests |
| `npm run lint` | Failed on pre-existing `.opencode/**` no-undef issues
outside this sweep's allowed file scope |


---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/c23740fe74b7a02f5cf2c5a127178219)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
Automated nightly unsafe-cast remediation sweep. This PR fixes two
remaining web-package unsafe cast sites by parsing or narrowing
boundary/opaque data instead of asserting, following the TypeScript
Coding Standards unsafe-cast / parse-don't-assert guidance and the Zod
boundary-validation pattern established in PR ColeMurray#807.

| Finding | Risk | Cast removed | Fix |
| --- | --- | --- | --- |
| `packages/web/src/lib/tasks.ts:41` | Medium | `latestTodoWrite.args as
TodoWriteArgs` for opaque sandbox tool-call args | Added a local Zod
schema for the consumed TodoWrite args and `safeParse`; malformed args
preserve the existing empty-list behavior. |
| `packages/web/src/components/settings/data-controls-settings.tsx:72` |
High | `await res.json()` trusted as `SessionListResponse` for
archived-session pagination | Added a canonical session-list response
schema and shared fetcher used by initial and load-more requests;
malformed responses hit the existing catch/log path. |

Verification:

| Command | Result |
| --- | --- |
| `npm run build -w @open-inspect/shared` | Passed |
| `npm run build -w @open-inspect/web` | Passed |
| `npm run typecheck` | Passed |
| `npm run format` | Passed |
| `npm test -w @open-inspect/web -- --run src/lib/tasks.test.ts
src/components/settings/data-controls-settings.test.tsx` | Passed |
| `npm test -w @open-inspect/web` | Passed: 157 files, 1159 tests |
| `npm run lint -w @open-inspect/web` | Passed |
| `npm run lint` | Failed on pre-existing `.opencode/` JavaScript
globals (`Headers`, `fetch`, `process`, etc.) outside the touched files;
PR opened as draft per sweep instructions. |

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/7c0bca8b4624321b48bb19ce9a137ee6)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
This is an automated nightly unsafe-cast remediation sweep. It replaces
selected unsafe TypeScript assertions over persisted or loose boundary
data with runtime narrowing, preserving existing null/skip behavior for
malformed values and leaving valid inputs unchanged. The fixes follow
the TypeScript Coding Standards unsafe-cast / parse-don't-assert
guidance and the Zod boundary-validation pattern established in PR ColeMurray#807;
these particular findings were simple persisted-data shapes, so
lightweight inline guards were sufficient and no dependency changes were
made.

| Finding | Risk | Cast removed | Fix |
| --- | --- | --- | --- |
| `packages/control-plane/src/session/tunnel-urls.ts:28` | Medium |
`parsed as Record<string, string>` after parsing stored
`sandbox.tunnel_urls` JSON | Inline guard builds a fresh `Record<string,
string>` only after validating every entry |
| `packages/control-plane/src/session/pr-artifacts.ts:20` | Medium |
`parsed as { repoOwner?: unknown; repoName?: unknown }` after parsing
stored PR artifact metadata | Inline `isRecord` guard before reading
repo identity fields; malformed metadata still returns `null` |
| `packages/control-plane/src/sandbox/lifecycle/image-selection.ts:125`
| Medium | `primary as { baseSha?: unknown }` after parsing stored
`repository_shas` JSON | Inline `isRecord` guard before reading
`baseSha`; malformed provenance still yields `null` |
| `packages/web/src/lib/session-socket/artifact-metadata.ts:65` | Medium
| `artifact.metadata as Record<string, unknown> | null` from loose
session artifact wire metadata | Inline `isRecord` guard before UI
metadata narrowing; non-object metadata is ignored |

Verification:

| Command | Result |
| --- | --- |
| `npm run build -w @open-inspect/shared` | Passed |
| `npm run build -w @open-inspect/control-plane` | Passed |
| `NODE_ENV=production npm run build -w @open-inspect/web` | Passed |
| `npm run typecheck` | Passed |
| `npm run lint -- --ignore-pattern '.opencode/**'` | Passed;
`.opencode` is untracked local tooling in this workspace and is excluded
from the PR |
| `npm run lint -w @open-inspect/control-plane` | Passed |
| `npm run lint -w @open-inspect/web` | Passed |
| `npm test -w @open-inspect/control-plane` | Passed |
| `npm test -w @open-inspect/web` | Passed when run isolated; concurrent
run with control-plane tests timed out in two existing ESLint-boundary
tests, then passed on isolated rerun |
| `npm run format` | Passed |
| `git diff --check` | Passed |

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/9c22735b7a63f6e49a3d58042e10a5bd)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
| Finding | Risk | Cast removed | Fix |
| --- | --- | --- | --- |
| `packages/control-plane/src/routes/session-ws-token.ts:23` | HIGH |
`parseJsonBody<{ scmLogin?: string; scmName?: string; scmEmail?: string
}>` generic request-body assertion for an auth/session token path |
Added a local Zod schema and `safeParse` after preserving raw-body
identity enforcement |
| `packages/control-plane/src/routes/image-builds.ts:339` | HIGH |
`parseJsonBody<{ enabled?: unknown }>` generic request-body assertion
feeding repo image-build persistence | Parsed JSON as `unknown` and used
an inline record/boolean guard before persistence |
| `packages/control-plane/src/routes/session-child-spawn.ts:97` | MEDIUM
| `(await spawnContextRes.json()) as { error?: unknown }` on an opaque
session-runtime response | Parsed as `unknown` and used an inline
record/string guard, preserving the existing fallback message |

Verification:

| Command | Result |
| --- | --- |
| `npm run format` | Passed |
| `npm test -w @open-inspect/control-plane` | Passed, 172 files / 2598
tests |
| `npm run build -w @open-inspect/shared` | Passed |
| `npm run build -w @open-inspect/control-plane` | Passed |
| `npm run typecheck` | Passed |
| `npm run lint -w @open-inspect/control-plane` | Passed |
| `git diff --check` | Passed |
| `npm run lint` | Failed on pre-existing `.opencode` files (`process`,
`fetch`, `Headers`, etc. reported as undefined), unrelated to this PR |

No dependency changes.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/6347ee0b9042691211c410eacb804bcd)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
This is an automated nightly unsafe-cast remediation sweep. It replaces
selected high-risk unsafe TypeScript casts with parse-don't-assert
validation at trust boundaries, following the TypeScript Coding
Standards for unsafe casts and the Zod boundary-validation pattern
established in PR ColeMurray#807.

| Finding | Risk | Cast removed | Fix |
| --- | --- | --- | --- |
| `packages/slack-bot/src/callbacks.ts:353` | HIGH | `payload as
AutomationSkipPayload` after `request.json()` | Added a local Zod
`automationSkipSchema` and uses `safeParse` before signature validation
and async handling. |
| `packages/control-plane/src/scheduler/durable-object.ts:864` | HIGH |
`event as SlackAutomationEvent` after `automationEventSchema.safeParse`
| Replaced the cast with discriminant narrowing from the
already-validated automation event union. |

Verification:

| Command | Result |
| --- | --- |
| `npm test -w @open-inspect/slack-bot` | Passed: 34 files, 422 tests. |
| `npm test -w @open-inspect/control-plane` | Passed: 161 files, 2540
tests. |
| `npm run build -w @open-inspect/shared` | Passed. |
| `npm run build -w @open-inspect/control-plane` | Passed. |
| `npm run build -w @open-inspect/slack-bot` | Passed. |
| `npm run format` | Passed. |
| `npm run typecheck` | Passed. |
| `npm run lint -w @open-inspect/control-plane` | Passed. |
| `npm run lint -w @open-inspect/slack-bot` | Passed. |
| `npm run lint -- --ignore-pattern .opencode/` | Passed for the tracked
repository tree. |
| `git diff --check` | Passed. |

Reference: TypeScript Coding Standards unsafe-cast / parse-don't-assert
guidance and the Zod webhook normalizer pattern from PR ColeMurray#807.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/13cffa9a6e1265b60e4deb0ebffcb302)*

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
ColeMurray and others added 27 commits August 28, 2026 16:22
…oleMurray#1649)

Tier 4 (modal-infra hygiene) of the image-build cleanup review,
re-verified against current main before touching anything. Two of the
six recorded findings turned out to be already fixed by intervening
work. Net −373 lines of dead surface. The deep review surfaced a real
capability the first revision missed (see item 1); adopting it is
deliberately deferred to ColeMurray#1658 rather than folded in here.

## Already fixed on main — no changes

- **Request-logging scaffold ×7 in web_api.py**: consolidated since the
review into `_execute_endpoint` / `_EndpointExecution`; all eight
endpoints use it and `_log_build_http_request` is gone.
- **`create_sandbox` / `restore_from_snapshot` ~130-line duplication**:
already extracted into `_launch_sandbox` + `_SandboxLaunchSpec` with
typed image-source variants. The hot-path item this review deferred to
last no longer exists.

## Implemented

### 1. The no-op image-delete round trip is removed; real deletion is
deferred to ColeMurray#1658

`api_delete_provider_image` never deleted anything — it logged
`image.delete_requested` and answered `"deleted": true` — but cost a
deployed function plus an authenticated HTTP request per
reaper/finalizer cleanup. `ModalSandboxProvider.deleteProviderImage` is
now a local no-op; the `ModalImageBuildProvider` interface and adapter
delegation are unchanged, so E2B/Vercel/OpenComputer deletions are
untouched, and the reaper/finalizer callers keep logging each attempt
and outcome. Deleted: the Modal endpoint + request model,
`ModalClient.deleteProviderImage` with its types/schema/URL wiring, and
the associated tests; the README row is gone. Verified first: nothing
consumes the `image.delete_requested` log line, and terraform has no
reference to the endpoint URL.

The deep review correctly flagged that the "Modal doesn't have an
explicit delete API" comment this cleanup relied on is stale: the locked
SDK (modal 1.4.3) exposes `modal.experimental.image_delete` (verified in
the locked venv; `@synchronizer.create_blocking` provides the `.aio`
form), and the reaper treats a fulfilled delete as proof it can clear
the row carrying `provider_image_id` — so with fake success, reaped
Modal images are retained provider-side untracked. Two things to note
about that:

- **This PR does not change retention behavior in either direction** —
the previous endpoint body was equally fake success, so the leak
predates it.
- **Adopting the real deletion is deliberately deferred to ColeMurray#1658**:
`image_delete` is an experimental interface (its own docstring warns the
stable form may differ), and we want to validate it before wiring the
cleanup path to it. Commit `40ba25674` (reverted in this PR) preserves a
complete, tested reference implementation — real endpoint with
idempotent `NotFoundError` handling and error propagation, restored
client/provider round trip, and coverage — to restore once validation
passes. The no-op's comment documents the deferral.

The auth-before-validation test that used the delete endpoint as its
vehicle now runs against `api_terminate_build_sandbox` (renamed
accordingly; the invariant it guards is endpoint-independent). The
400-log-fields assertion it duplicated is already covered on another
endpoint.

### 2. Dead module surface in the sandbox package

All verified zero-caller (both this repo and downstream): the
`get_manager`/`get_sandbox_config`/`get_sandbox_handle` lazy accessors,
the module-global `sandbox_manager` instance,
`SandboxHandle.get_logs`/`terminate`, and the fabricated `snap-…` id in
`take_snapshot` that was logged once and discarded (the
`sandbox.snapshot` log keeps `sandbox_id`/`image_id`, which are the
queryable identifiers). `SandboxHandle.snapshot_id` — the
restore-provenance field asserted by the launch-spec tests — stays.

### 3. Dead pre-bridge event protocol in sandbox-runtime

`SandboxEvent` and its seven pydantic subclasses (`HeartbeatEvent` …
`ArtifactEvent`) are relics of a protocol the bridge replaced with plain
dicts; zero constructors or importers outside the two `__init__.py`
re-exports. `GitSyncStatus` went with them — its only reader was
`GitSyncEvent` (the control plane's `GitSyncStatus` is a separate TS
type in `@open-inspect/shared`).
`GitUser`/`SessionConfig`/`McpServerConfig`/`SandboxStatus` are live and
stay.

### 4. Residue

- `websockets>=13.0` dropped from modal-infra's dependencies: nothing in
modal-infra imports it. The sandbox image's pip list in `images/base.py`
and sandbox-runtime's own dependency (the real importer) are unaffected.
Lockfile regenerated.
- `api_snapshot_sandbox` no longer reads or echoes
`session_id`/`reason`: the control plane's response schema reads only
`image_id`, and endpoint logging uses the correlation headers, so the
body fields were dead in both directions. The client stops sending them;
`SnapshotSandboxRequest.reason` is gone (provider-level
`SnapshotConfig.reason` stays — OpenComputer embeds it in checkpoint
names). The generic-snapshot identity test still passes unchanged, since
a crafted `reason` now can't influence anything by construction.
- README: `src/sandbox/` listing described files that moved to
`packages/sandbox-runtime` long ago and claimed a "warm" operation the
manager doesn't have; now matches the real module layout.

## Deliberately kept

The `modal>=1.4.3` floor and its `with_options()` comment: the review
flagged the justification as stale, but the floor has since been
re-justified — `Function.with_options()` per-call timeout override
genuinely requires it.

## Verification

- modal-infra pytest 217/217, sandbox-runtime pytest 775/775, ruff clean
- control-plane unit 3319/3319 and integration 1006/1006, workspace
typecheck + both test tsconfig programs clean
- Deleted-symbol grep across the full tree returns only the intended
survivors (interface member + no-op implementation)


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

## Summary by CodeRabbit

- **Changes**
- Simplified sandbox snapshot requests and responses by removing session
and reason details.
  - Removed provider-image deletion support from the sandbox APIs.
- Reduced public sandbox runtime exports to supported configuration and
status types.
- Removed deprecated sandbox event models and unsupported sandbox handle
operations.

- **Documentation**
- Updated sandbox component documentation to reflect the current runtime
structure, lifecycle terminology, and removal of the image-deletion
endpoint.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

- preserve mobile settings search and scroll context while opening
detail panels, and restore focus to the originating category after
browser or in-app Back navigation
- use shared input/button focus treatments, expose active mobile
navigation semantics, announce empty search results, and increase mobile
header actions to 44px touch targets
- avoid rendering the desktop settings structure during mobile hydration
by sharing the resolved settings viewport through the route shell
- correct integration detail heading hierarchy and make Slack routing
rules stack cleanly on narrow screens
- add regression coverage for focus restoration, retained search state,
focus treatments, heading levels, and responsive routing controls

## Validation

- `npm run build -w @open-inspect/shared`
- `npm run typecheck -w @open-inspect/web`
- `npm run lint -w @open-inspect/web -- --no-fix`
- `npm test -w @open-inspect/web -- --maxWorkers=4` (170 files, 1,308
tests)
- `NODE_ENV=production npm run build -w @open-inspect/web`
- `git diff --check`

## Manual Verification

Tested against a local mock control plane with an authenticated user:

- 390x844 mobile settings search → Appearance detail → browser Back
- confirmed the search query remains populated, focus returns to
Appearance, and `aria-current` remains accurate
- confirmed the Appearance controls stack without compression
- confirmed the Slack integration at 320x844 has no horizontal overflow
and follows `h1` → `h2` → `h3` heading order

Visual recording artifact: `7fe72d4f66822633d4cbc0aea64646bb`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/813b354124416569fd45908400e81c6c)*

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

* **Accessibility**
* Improved heading structure across integration settings for clearer
screen-reader navigation.
  * Enhanced focus restoration when navigating mobile settings.
* Improved accessibility semantics for active navigation items and
mobile actions.

* **Mobile Experience**
* Improved navigation between settings category lists and detail views.
  * Preserved mobile search state during browser-history navigation.
  * Updated mobile controls with larger, more consistent buttons.

* **Layout**
  * Improved Slack routing-rule layout on smaller screens.

* **Reliability**
  * Added a smoother loading state while settings finish initializing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary
- replace competing React and cmdk settings filters with one
command-level all-term filter
- remove forced settings item mounting and query reset state
- preserve order-independent search for settings, navigation commands,
and sessions
- add regression coverage for session search through the shared filter

## Verification
- `npm test -w @open-inspect/web` (170 files, 1,311 tests)
- `npm run build -w @open-inspect/shared`
- `npm run typecheck -w @open-inspect/web`
- `npm run lint -w @open-inspect/web -- --no-fix`
- browser verification at desktop viewport: searching `appearance`
returns the Appearance settings destination
- production build compiles and passes TypeScript; prerender remains
blocked by the existing `/ui-prototypes/provider-accounts` crash
unrelated to this diff

## Artifact
![Global command search returning
Appearance](linear-attachment://135ba03e208d3a3a43ffcd5cd969cefc)

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/3c43ceac7f30f69c8c4924a321088042)*

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

* **Bug Fixes**
* Improved command menu search to match multiple search terms regardless
of their order.
* Search now considers item names and available keywords for more
accurate results.
  * Improved consistency across command menu and settings searches.
* Simplified search behavior when closing and reopening the command
menu.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
…y#1667)

## Summary

- compose event-triggered automation prompts with stable instructions
before variable event context
- route both plain events and Slack thread-enriched events through one
composition helper
- make instruction-first ordering unconditional, as requested in ColeMurray#1657
- update scheduler assertions and add focused coverage for ordering and
stable prompt prefixes

## Context

This supersedes ColeMurray#1657 because the original contributor branch cannot be
modified. The contributor's commits and authorship are preserved, with a
follow-up commit removing the deployment flag per maintainer feedback.

## Testing

- `npm test -w @open-inspect/control-plane` (3344 passed)
- `npm test -w @open-inspect/control-plane --
src/scheduler/compose-automation-prompt.test.ts
src/scheduler/scheduler.test.ts` (80 passed)
- `npm run typecheck -w @open-inspect/control-plane`
- `npm run lint -w @open-inspect/control-plane`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/9e9ac9ca3a1eaf76085f22270dc63126)*

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

* **Improvements**
* Automation prompts now consistently place workspace instructions
before event-specific context.
* Prompt formatting is standardized across Slack and other automation
sessions, including immediate and deferred runs.
  * Instructions remain stable even when event-specific context changes.

* **Tests**
  * Added coverage to verify prompt ordering and consistent formatting.
  * Updated scheduler expectations to reflect the new prompt format.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Basit Mustafa <basit.mustafa@gmail.com>
Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary

- show a filled right rail when the desktop session-details sidebar is
open
- preserve the existing outlined icon when the sidebar is closed
- keep the existing accessible labels, expanded state, and toggle
behavior
- cover both icon states in the existing `SessionHeader` test

## Context

This is a maintainer-owned replacement for ColeMurray#1652 because the original
contributor branch cannot be modified. It preserves the feature proposed
by @ravidsrk while incorporating the requested formatting fix and
aligning the implementation with the existing shared icon module and
test suite.

Fixes ColeMurray#1476.

## Verification

- `npm test -w @open-inspect/web -- --run
src/components/session-header.test.tsx`
- `npm test -w @open-inspect/web` (170 files, 1,311 tests)
- `npm run lint`
- `npm run typecheck -w @open-inspect/web`
- changed files pass Prettier

Repository-wide `npm run format:check` still reports the pre-existing
`.opencode/package.json`, which is not modified by this PR.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/8ca45b4473ac9e414919c05605d217b7)*

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

## Summary by CodeRabbit

* **New Features**
* Added a distinct icon for the session details panel toggle when the
panel is open.
* The toggle now clearly indicates whether session details are shown or
hidden.

* **Tests**
* Updated coverage to verify the correct icon appears for each panel
state.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary
- extract a shared settings card section and replace four duplicate
implementations across SCM, Code Server/VNC, Slack, and Linear settings
- add Analytics and supporting descriptions to global command navigation
- add an accessible command-search label, live result count, and
keyboard guidance
- cover destination parity, keyboard selection, descriptions, and count
updates

## Validation
- `npm test -w @open-inspect/web` (170 files, 1,314 tests)
- `npm run build -w @open-inspect/shared`
- `npm run typecheck -w @open-inspect/web`
- `npm run lint -w @open-inspect/web -- --no-fix`
- Prettier and `git diff --check`
- desktop and mobile browser verification for the command menu and Slack
settings cards

## Visuals

### Command menu
![Desktop command
menu](linear-attachment://8929c62c0bab8d6475ef00741508b7b5)

![Mobile command
menu](linear-attachment://6d840efcd8ff1e4c7a6c640790c0f5a8)

### Shared settings cards
![Desktop settings
cards](linear-attachment://fca172df88fb037ffde7c7c16e847fe3)

![Mobile settings
cards](linear-attachment://d8887793d77af5c67033078805e0102b)

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/3c43ceac7f30f69c8c4924a321088042)*

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

- **New Features**
- Unified navigation destinations across the command menu and sidebar,
including Settings, Automations, and Analytics.
- Added descriptive navigation text, improved icons, keyboard guidance,
live result counts, and an empty-results message.
- Selecting a matching command now navigates to the destination and
closes the menu.
- Standardized settings sections with consistent card-style presentation
across integrations and source-control settings.

- **Tests**
- Added coverage for navigation links, descriptions, keyboard
interactions, result counts, and empty search results.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary

Adds focused web BFF route tests for recently added managed-skill
repository import flows:

- import confirmation forwards the full confirmation body unchanged
- re-import preview forwards encoded skill IDs and preview parameters
correctly
- existing coverage continues to verify auth/error propagation and
revision precondition forwarding

These routes are high-risk because they proxy authenticated skill
administration requests and must preserve source provenance,
preview-confirmation digests, and encoded skill identifiers exactly.

## Tests

- `npm test -w @open-inspect/web -- managed-skills-routes.test.ts`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/479e814ca52fe712c8d452cfb2214d06)*

---------

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary

- define shared RBAC roles, permissions, and authorization contracts
- add D1-backed authorization persistence and service APIs
- add the RBAC migration, workspace-owner bootstrap CLI, and
migration/compatibility coverage
- incorporate review hardening for canonical role identity, precise
missing-resource outcomes, atomic user merging, suspension and
attribution preservation, catalog fencing, and exact bootstrap
provenance

## Stack

This is **1 of 6** and targets `main`.

Merge order:
1. `rbac-foundation` (this PR)
2. `rbac-http-enforcement`
3. `rbac-session-authorization`
4. `rbac-automation-authorization`
5. `rbac-workspace-settings`
6. `rbac-permission-aware-ui`

## Validation

- control-plane unit tests: 3,352 passed
- control-plane integration tests: 1,018 passed
- workspace-owner bootstrap tests: 13 passed
- user-merge CLI adapter tests: 2 passed
- shared RBAC tests: 11 passed
- repository ESLint, formatting, and typecheck passed

## Related pull requests

[ColeMurray#1677](ColeMurray#1677) ->
[ColeMurray#1676](ColeMurray#1676) ->
[ColeMurray#1674](ColeMurray#1674) ->
[ColeMurray#1678](ColeMurray#1678) ->
[ColeMurray#1675](ColeMurray#1675) ->
[ColeMurray#1673](ColeMurray#1673)


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

* **New Features**
* Added role-based access control with Owner, Administrator, Member, and
Viewer roles.
* Added permission-aware member management, including role changes and
account suspension controls.
  * Added audit tracking for authorization changes and user merges.
  * Added a guarded workflow for assigning the first workspace Owner.
* **Bug Fixes**
  * Improved user-merge handling and atomicity across related records.
  * Prevented unauthorized ownership transfers through custom roles.
* **Chores**
* Added migration support for existing and new users under the RBAC
model.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…1676)

## Summary

- make authentication and authorization policy explicit for every HTTP
route
- enforce active-user and permission requirements at the router boundary
- map service principals to bounded permissions and propagate bot actors
consistently
- expose read-only RBAC role, member, and current-user authorization
endpoints

## Stack

This is **2 of 6** and targets `rbac-foundation`.

Merge order: `rbac-foundation` -> `rbac-http-enforcement` (this PR) ->
`rbac-session-authorization` -> `rbac-automation-authorization` ->
`rbac-workspace-settings` -> `rbac-permission-aware-ui`.

## Validation

- control-plane unit tests: 3,377 passed
- control-plane integration tests: 1,027 passed
- Linear bot tests: 233 passed
- Slack bot tests: 432 passed
- repository typecheck passed

## Related pull requests

[ColeMurray#1677](ColeMurray#1677) ->
[ColeMurray#1676](ColeMurray#1676) ->
[ColeMurray#1674](ColeMurray#1674) ->
[ColeMurray#1678](ColeMurray#1678) ->
[ColeMurray#1675](ColeMurray#1675) ->
[ColeMurray#1673](ColeMurray#1673)


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

* **New Features**
* Added role- and permission-based access controls across control-plane
routes.
  * Added endpoints for viewing access, roles, and workspace members.
* Added service-specific permission limits and automation authorization.
* Added session-target authorization and actor attribution for Linear
and Slack actions.

* **Bug Fixes**
  * Suspended workspace access is now blocked.
  * Actorless or unidentified service requests now fail safely.
  * Conflicting actor identities return a clear retryable error.
* Health checks remain available when authorization data is unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…ray#1674)

## Summary

- enforce canonical session access inside the Session durable object
- add short-lived authorization leases to connected WebSockets
- revoke stale sockets when a user's authorization expires or changes
- tighten session repository visibility and lifecycle authorization
coverage

## Stack

This is **3 of 6** and targets `rbac-http-enforcement`.

Merge order: `rbac-foundation` -> `rbac-http-enforcement` ->
`rbac-session-authorization` (this PR) ->
`rbac-automation-authorization` -> `rbac-workspace-settings` ->
`rbac-permission-aware-ui`.

## Validation

- shared tests: 791 passed
- control-plane unit tests: 3,372 passed
- control-plane integration tests: 1,029 passed
- control-plane typecheck passed

## Related pull requests

[ColeMurray#1677](ColeMurray#1677) ->
[ColeMurray#1676](ColeMurray#1676) ->
[ColeMurray#1674](ColeMurray#1674) ->
[ColeMurray#1678](ColeMurray#1678) ->
[ColeMurray#1675](ColeMurray#1675) ->
[ColeMurray#1673](ColeMurray#1673)


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

## Summary by CodeRabbit

- **New Features**
- WebSocket connections now verify required session permissions and
automatically expire when authorization changes.
- The web app refreshes credentials and reconnects when authorization is
revoked.
- Temporary server errors trigger automatic reconnection using the
existing credential.
- WebSocket authorization state now persists across session runtime
recovery.

- **Changes**
  - Participant creation through the session API is no longer available.
- Session lifecycle actions no longer require participant identity in
request bodies.
  - WebSocket token requests now require a canonical user identity.
  - Updated session endpoint documentation to reflect current behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…y#1678)

## Summary

- add automation admission and ownership authorization guards
- enforce create, manage, trigger, scheduler, invocation, and webhook
authority
- persist canonical automation ownership and expose it in shared
contracts
- cover own-vs-any permission behavior across execution paths

## Stack

This is **4 of 6** and targets `rbac-session-authorization`.

Merge order: `rbac-foundation` -> `rbac-http-enforcement` ->
`rbac-session-authorization` -> `rbac-automation-authorization` (this
PR) -> `rbac-workspace-settings` -> `rbac-permission-aware-ui`.

## Validation

- shared tests: 792 passed
- control-plane unit tests: 3,380 passed
- focused automation integration tests: 105 passed
- control-plane typecheck passed

## Related pull requests

[ColeMurray#1677](ColeMurray#1677) ->
[ColeMurray#1676](ColeMurray#1676) ->
[ColeMurray#1674](ColeMurray#1674) ->
[ColeMurray#1678](ColeMurray#1678) ->
[ColeMurray#1675](ColeMurray#1675) ->
[ColeMurray#1673](ColeMurray#1673)


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

## Summary by CodeRabbit

- **New Features**
- Added ownership-aware automation authorization for viewing, managing,
triggering, and executing automations.
- Added permission checks when automations target repositories or
environments.
  - Manual runs now execute under the requester’s identity.
- Collaboration actions can be authorized independently from automation
launch permissions.

- **Bug Fixes**
  - Unauthorized executions are blocked and reported appropriately.
  - Scheduled automations are paused after authorization failures.
  - Legacy automation ownership is repaired automatically when possible.
  - Improved handling of missing, suspended, or deleted identities.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

- add workspace member, role, and status administration endpoints
- expose Next.js BFF routes and current-user authorization hooks
- add permission-aware settings navigation and controls
- add a workspace access administration settings surface

## Stack

This is **5 of 6** and targets `rbac-automation-authorization`.

Merge order: `rbac-foundation` -> `rbac-http-enforcement` ->
`rbac-session-authorization` -> `rbac-automation-authorization` ->
`rbac-workspace-settings` (this PR) -> `rbac-permission-aware-ui`.

## Validation

- RBAC route integration tests: 19 passed
- web typecheck passed
- focused affected web tests: 102 passed

## Related pull requests

[ColeMurray#1677](ColeMurray#1677) ->
[ColeMurray#1676](ColeMurray#1676) ->
[ColeMurray#1674](ColeMurray#1674) ->
[ColeMurray#1678](ColeMurray#1678) ->
[ColeMurray#1675](ColeMurray#1675) ->
[ColeMurray#1673](ColeMurray#1673)
## Summary

- gate session actions and controls using the current user's permissions
- gate automation creation, management, and triggering with own-vs-any
authority
- surface authorization-aware empty, denied, and read-only states
- document RBAC behavior, deployment, and design decisions

## Stack

This is **6 of 6** and targets `rbac-workspace-settings`.

Merge order: `rbac-foundation` -> `rbac-http-enforcement` ->
`rbac-session-authorization` -> `rbac-automation-authorization` ->
`rbac-workspace-settings` -> `rbac-permission-aware-ui` (this PR).

## Validation

- repository typecheck passed
- production web build passed
- web suite: 1,382 passed; four resource-sensitive timeouts pass in
isolation (77/77)
- PR ColeMurray#1677 review follow-up: control-plane unit 3,352 passed;
integration 1,018 passed; bootstrap 13 passed; user-merge CLI adapter 2
passed; repository ESLint and formatting passed

## Related pull requests

[ColeMurray#1677](ColeMurray#1677) ->
[ColeMurray#1676](ColeMurray#1676) ->
[ColeMurray#1674](ColeMurray#1674) ->
[ColeMurray#1678](ColeMurray#1678) ->
[ColeMurray#1675](ColeMurray#1675) ->
[ColeMurray#1673](ColeMurray#1673)

## Original parity and review delta

The stack was originally created byte-identical to the original
[ColeMurray#1662](ColeMurray#1662) head
(`fa3464ad`, tree `ed4b0e47b1af3545b34c3d4842e9266a39c395c7`). It now
intentionally differs only by the 16 review-fix files from PR ColeMurray#1677
(`4866d41a3` and `675a55449`), which have been propagated through every
downstream branch.


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

## Summary by CodeRabbit

- **New Features**
- Added comprehensive authentication, authorization, workspace roles,
and deployment guidance.
- Added permission-based controls for session creation, collaboration,
lifecycle actions, sandbox access, and automation management.
- Added safer session behavior that hides sandbox links and data when
access is unavailable.
- Added automatic handling for revoked session permissions and
unauthorized actions.

- **Bug Fixes**
- Restricted automation controls and session actions to authorized
users.
- Improved authorization behavior for session connections and commands.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary

- allow the Slack and Linear bot services to read session events and
artifacts without an asserted user actor
- keep the exception scoped to the two completion-extractor endpoints
and protected by each service's `sessions.read` permission ceiling
- add route-policy and integration coverage for the exact actorless
allowlist

## Root cause

The RBAC HTTP-boundary change made `GET /sessions/:id/events` and `GET
/sessions/:id/artifacts` actor-required routes. Slack and Linear
completion callbacks use the shared extractor after the original request
has completed, and the queued callback does not carry an actor
assertion. Production telemetry confirmed Slack authenticated
successfully as a service principal but was rejected with HTTP 403
before any D1 query.

The media endpoint already has the equivalent narrow Slack actorless
grant; this change restores the prerequisite completion reads without
weakening other session routes.

## Validation

- `npm test -w @open-inspect/control-plane -- src/router.policy.test.ts`
- `npm run test:integration -w @open-inspect/control-plane --
test/integration/service-auth.test.ts`
- `npm run typecheck -w @open-inspect/control-plane`
- `npm run build -w @open-inspect/control-plane`
- ESLint and Prettier checks on changed files

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/6c1b1679156a928d0aa8a590ceeb3029)*

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

## Summary by CodeRabbit

* **New Features**
* Slack and Linear bot integrations can now access session event and
artifact completion-read endpoints without a user actor.

* **Bug Fixes**
* Corrected authorization for actorless session completion reads while
preserving existing restrictions on unrelated callbacks and media
access.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary
- instruct the GitHub reviewer to accumulate findings before publishing
- submit the review summary and all inline findings in one `/reviews`
API request
- prevent regressions to standalone inline comment requests and unsafe
shell interpolation
- preserve `COMMENT` reviews for bot-authored pull requests

## Why
Standalone review comments are not part of the final submitted review
consumed by Autofix. Batching them into the review's `comments` array
ensures GitHub emits one complete submitted review and Autofix receives
all findings in one attempt.

## Validation
- `npm test -w @open-inspect/github-bot`
- `npm run typecheck -w @open-inspect/github-bot`
- `npm run lint -w @open-inspect/github-bot`
- Prettier check on changed files
- `git diff --check`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/5ce0f93565c54f68464ad4d5db973bbc)*

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

* **Improvements**
* Streamlined automated pull request reviews by submitting summaries and
inline comments together in a single review.
* Improved support for repositories with nested owners when creating
reviews.
  * Clarified the supported review outcomes for automated code reviews.

* **Bug Fixes**
* Reduced the risk of incomplete or split review feedback by
consolidating submissions into one operation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary

- add explicit audit outcomes and structured before/requested/after
metadata
- record default Member role assignments atomically from the database
trigger
- treat repeated role and suspension requests as audited no-ops without
touching state or sessions
- improve Owner bootstrap and user-merge provenance, including affected
role and suspension state
- preserve the existing atomic coupling between successful RBAC
mutations and their audit records

## Why

The initial RBAC audit events identified who acted and which user was
targeted, but did not record the actual authorization change. Repeated
writes were also indistinguishable from real changes, default grants
were absent, and operator-driven user merges lacked unique provenance.

## Testing

- `npm run test:integration -w @open-inspect/control-plane` (87 files,
1075 tests)
- `npm test -w @open-inspect/control-plane --
src/db/authorization-store.test.ts`
- `npm run test:rbac-bootstrap-owner`
- `npm run test:user-merge-cli`
- `npm run typecheck -w @open-inspect/control-plane`
- `npm run lint -w @open-inspect/control-plane`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/97badb97b9dc770a3214927e8ed1bd16)*

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

* **New Features**
  * Authorization updates now report when a request makes no changes.
* Audit records include operation results and structured before,
requested, and after state details.
* User merges and automatic role assignments provide richer audit
information.

* **Bug Fixes**
* Identical role or status updates no longer alter user state or
authentication sessions.
  * Audit failures now prevent related user changes from being saved.
  * Existing audit data is preserved and upgraded during migration.
* Bootstrap and migration processes now record complete role-assignment
audit details.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary

- append an authoritative trust-boundary guardrail after event-specific
automation context
- preserve the stable instruction-first prefix used for provider prompt
caching
- clarify that untrusted event content cannot override configured
automation or workspace instructions
- update prompt composition and Slack scheduler assertions for the
secured ordering

## Security impact

Slack, Sentry, and other event-derived content no longer occupies the
final instruction position in unattended automation prompts. The
trailing trusted reminder reduces the risk that prompt injection in
event data overrides the automation's configured behavior.

## Source

Ported from ColeMurray/open-inspect-claude-prod#133 with the original
commit authorship preserved.

## Testing

- `npm test -w @open-inspect/control-plane --
src/scheduler/compose-automation-prompt.test.ts
src/scheduler/scheduler.test.ts` (84 passed)
- `npm run typecheck -w @open-inspect/control-plane`
- `npm run lint -w @open-inspect/control-plane`
- `git diff --check origin/main...HEAD`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/34bd317e0e5ab003e4a82bf4d16fe64e)*

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

## Summary by CodeRabbit

* **Security**
* Added a prompt safeguard that clearly distinguishes trusted
instructions from event context.
* Event-provided content can no longer override or modify trusted
automation instructions.

* **Tests**
* Updated automated checks to verify the safeguard appears consistently
across supported event-handling scenarios.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary

- increase the per-session unfinished prompt limit from 10 to 50
- retain the existing centralized admission checks and queue-full
behavior

## Testing

- `npm run build -w @open-inspect/shared`
- `npm test -w @open-inspect/shared`
- `npm test -w @open-inspect/control-plane --
src/session/message-queue.test.ts
src/session/message-repository.test.ts`
- `npm run test:integration -w @open-inspect/control-plane --
test/integration/websocket-client.test.ts
test/integration/prompt-enqueue.test.ts`
- `npx prettier --check packages/shared/src/types/prompts.ts`
- `npx eslint packages/shared/src/types/prompts.ts`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/9493ea6b540d830f764d2ae560c79043)*

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

## Summary by CodeRabbit

- **Improvements**
- Increased the maximum number of unfinished prompts that can be
retained from 10 to 50.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
## Summary

- persist denied RBAC decisions at the centralized HTTP authorization
boundary
- persist allowed decisions for protected mutations and sensitive
managed reads
- include canonical actor/service snapshots, permission requirements,
request and trace IDs, route, response status, and denial reason
- preserve the original response when audit persistence fails, while
emitting an operational error
- atomically audit stale-actor denials, missing-resource rejections, and
last-Owner conflicts in member mutations
- keep member writes gated exclusively by the matching applied audit
event

## Why

The RBAC rollout enforced authorization centrally but left denied
attempts and most high-impact allowed requests visible only through
generic request logs. Rejected member mutations also produced no durable
record. This adds durable decision-level coverage without duplicating
audit calls across every route handler.

## Dependency

Stacked on ColeMurray#1687, which adds the audit outcome and structured metadata
fields used here.

## Testing

- `npm test -w @open-inspect/control-plane` (225 files, 3405 tests)
- focused integration suites (3 files, 28 tests)
- `npm run typecheck -w @open-inspect/control-plane`
- ESLint and Prettier on changed files

The full integration run reached 86 passing files and 1035 passing tests
before the existing force-eviction test crashed one workerd pool with
`ECONNRESET`; all directly affected integration suites pass.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/97badb97b9dc770a3214927e8ed1bd16)*

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

* **New Features**
* Added comprehensive authorization audit events for approved, denied,
rejected, and no-op requests.
* Audit records now include request details, required permissions,
principal information, response status, and decision outcomes.
* Added configurable auditing for route authorization policies,
including service and sandbox access.
  * Default role assignment actions now generate audit records.

* **Bug Fixes**
* Improved audit accuracy by recording the state actually applied during
role and membership changes.
  * Audit persistence failures no longer interrupt request processing.
  * Corrected permission reporting for bypassed authorization checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary

- attribute actorless Linear `created` agent sessions to the verified
installed Linear app user
- use the same actor for session creation and the initial prompt so RBAC
permits both requests
- keep human preferences and issue transitions tied to an actual human
creator
- add regression coverage for the signed actor headers while preserving
body identity restrictions

## Root cause

Automation-created Linear agent sessions can omit both
`agentSession.comment.userId` and `agentSession.creatorId`. The Linear
bot consequently omitted `X-OpenInspect-Actor` from `POST /sessions`,
which the control plane correctly rejected with `403
service_actor_required`.

## Validation

- `npm test -w @open-inspect/linear-bot` (233 tests passed)
- `npm run typecheck -w @open-inspect/linear-bot`
- `npm run lint -w @open-inspect/linear-bot`
- `npm run build -w @open-inspect/linear-bot`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/8fdbd5d2c64650f69b2cb0987e7c4281)*

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary
- remove genuinely unused provider-account helpers and request types
- narrow module APIs by making internal constants, functions, and types
private
- update Knip configuration to analyze sandbox runtime entry points
without false positives
- document the intentional keyboard shortcut request/response schema
alias

## Verification
- `npm run knip`
- `npm run typecheck`
- `npm test -w @open-inspect/control-plane` (3,399 tests)
- `npm test -w @open-inspect/web` (1,397 tests)
- `npm test -w @open-inspect/slack-bot` (432 tests)
- `git diff --check`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/eabe5991dd06163d2962b482487e4063)*

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

* **Refactor**
* Reduced the public API surface by making internal types, helpers,
constants, and schemas private.
  * Streamlined type re-exports and removed unused public interfaces.
* Consolidated keyboard-shortcut validation around a single schema
without changing behavior.
* **Chores**
  * Simplified workspace and dependency-analysis configuration.
* Updated duplicate-type handling and dependency ignore rules for
cleaner project checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
)

<!-- open-inspect-react-doctor-owner: nightly-automation -->
<!-- react-doctor-base-sha: 72fb7fc -->
<!-- react-doctor-bucket: web-safe-local-fixes -->
<!-- react-doctor-diagnostic-manifest:
react-doctor/no-array-index-as-key@src/components/automations/condition-builder.tsx:151;react-doctor/only-export-components@src/components/automations/condition-builder.tsx:36
-->

## Summary

Fixes **2 root-cause tasks** from the full `packages/web` React Doctor
scan.

1. **`react-doctor/no-array-index-as-key`** in
`src/components/automations/condition-builder.tsx`: condition editor
rows used their array position as React identity. Removing or reordering
conditions could transfer component state to the wrong row. The row now
uses the condition semantic key, which is already enforced as unique by
the builder.
2. **`react-doctor/only-export-components`** in
`src/components/automations/condition-builder.tsx`: the component module
also exported the label map, preventing a clean Fast Refresh boundary
and potentially forcing state-losing reloads during development. The map
now lives in `condition-labels.ts` and both consumers import it there.

Both findings were ungrouped diagnostics and therefore count as one task
each. No selected finding had a non-null `fixGroupId`; grouped findings
elsewhere were left intact.

## React Doctor Results

- Scanner: React Doctor `0.9.12`, schema version 3, full scope,
`@open-inspect/web`
- Before: **90 total** diagnostics, 2 errors, 88 warnings, score 62
- After: **88 total** diagnostics, 2 errors, 86 warnings, score 63
- `no-array-index-as-key`: 7 to 6
- `only-export-components`: 1 to 0
- Raw diagnostics cleared: **2**
- Changed-scope regression scan: **no issues found**
- No new full-scan rule/file/message findings were introduced.
Diagnostic IDs in touched files shifted with line numbers only.

## Validation

- `npx vitest run
src/components/automations/condition-builder.test.tsx`: passed, 29 tests
- `npm run typecheck -w @open-inspect/web`: passed
- `npm run lint -w @open-inspect/web`: passed
- `npx prettier --check packages/web`: passed
- `npm test -w @open-inspect/web`: passed, 1,287 tests
- `npx -y react-doctor@latest . --json --json-out
/tmp/react-doctor-after.json --yes --blocking none`: completed, selected
findings removed
- `npx -y react-doctor@latest . --verbose --scope changed --base
origin/main --yes --blocking none`: passed, no issues
- `npm run build -w @open-inspect/web`: reproduces the pre-existing
`/_global-error` prerender failure, `TypeError: Cannot read properties
of null (reading 'useContext')`, digest `3074926929`; compilation and
TypeScript complete first

Baseline tests initially had two 5-second authentication-boundary test
timeouts. They were transient and the complete post-change test run
passes, so no test failure remains.

## Deferred Findings

- The two error-severity `effect-needs-cleanup` findings are detector
false positives: the provider authorization timers are cleared by the
effect teardown, and the session WebSocket is closed by its mount-effect
teardown.
- State synchronization findings in auth-adjacent integration settings,
secrets, sidebar persistence, and automation forms require broader
lifecycle or UX judgment.
- Giant components, reducer migrations, dynamic chart imports, image
optimization, locale formatting, iframe sandboxing, and performance-only
loop rewrites require broader refactors, runtime evidence, security
review, or visual/product decisions.
- Remaining index-key findings lack stable IDs or are append-only data;
they were not changed speculatively.
- No visual verification was run because these changes do not alter
rendered styling or layout.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/5524f71cd31217e89b652a450068bbe8)*

Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary
- keep a sticky session timeline pinned to the physical bottom when its
viewport changes, including terminal preference restoration and panel
resizing
- keep the timeline pinned while virtual row measurements correct the
synthetic content height
- preserve the current position after a user intentionally scrolls away
from the bottom
- add a regression experiment covering viewport shrink, delayed content
growth, and user-scroll preservation

## Root cause
Timeline virtualization scrolls against estimated row heights.
Measurements can update the synthetic content height after the existing
`[events, isProcessing]` layout effect has run. Restoring an open
terminal after hydration also shrinks the timeline viewport without
changing either dependency, leaving the session above its new bottom.

## Validation
- `npm test -w @open-inspect/web --
src/components/session-timeline-scroll.test.tsx
src/components/session-timeline.test.tsx
src/lib/timeline-virtual-rows.test.ts` (44 tests passed)
- `npm run typecheck -w @open-inspect/web`
- ESLint on changed files
- full web suite: 1,396 tests passed; two concurrent resource-related
timeouts passed when rerun independently
- `git diff --check`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/12148d875927d2f52aa3a39f9b69d1af)*

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

* **Bug Fixes**
* Improved session timeline scrolling so it stays anchored at the bottom
as the viewport or content resizes.
* Preserved a user’s manual scroll position when they move away from the
bottom.
* Improved scrolling behavior as timeline content grows or new activity
is appended.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary
- add the `workspace.audit.read` permission and shared schemas for
durable audit event pages
- expose a human-user-only, permission-gated `GET /audit-events`
endpoint with strict query validation, no-store caching, and opaque
newest-first keyset pagination
- add the supporting D1 index plus a web BFF, validated SWR hook, and
dedicated responsive Workspace Audit Log settings page
- show outcome, timestamp, actor/resource snapshots, request/reason
context, expandable structured metadata, and Previous/Next navigation

## Authorization and behavior
- Owner and Administrator inherit audit-read access; Member and Viewer
do not
- custom roles may be granted audit-read access
- successful audit reads are not recursively audited, while denied reads
remain recorded
- historical snapshot values are displayed directly without joining
mutable user records

## Testing
- `npm test -w @open-inspect/shared` (798 tests)
- `npm test -w @open-inspect/control-plane` (3,415 tests)
- `npm run test:integration -w @open-inspect/control-plane` (1,082
tests)
- focused audit web tests (20 tests)
- web auth-boundary tests individually (12 tests)
- `npm run typecheck`
- `npm run lint`
- `npm run lint:complexity`
- `NODE_ENV=production npm run build -w @open-inspect/web`
- changed-file Prettier check and `git diff --check`

## Verification note
The aggregate web suite passed 1,406 tests but its two ESLint-boundary
tests exceeded their existing 5-second per-test timeout under full-suite
load; both files passed when rerun individually. Browser verification of
the authenticated panel was not possible locally because the sandbox has
no configured OAuth/control-plane session.

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/97badb97b9dc770a3214927e8ed1bd16)*

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

* **New Features**
  * Added a workspace **Audit log** view for authorized users.
* Display event details, including timestamps, outcomes, actors,
resources, request IDs, reason codes, and expandable structured details.
* Added cursor-based pagination with Previous and Next controls,
loading, empty, and retry states.
* Added a protected audit-events API endpoint and workspace audit-read
permission.
* **Bug Fixes**
  * Improved validation for pagination parameters and malformed cursors.
* **Tests**
* Added coverage for authorization, pagination, validation, rendering,
and error handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
## Summary
- normalize proxied Codex calls to a `Request` before rewriting the
endpoint
- preserve source request methods, bodies, headers, signals, and other
Fetch options
- replace the dummy authorization value with broker-provided account
credentials
- add regression coverage for a POST supplied as a source `Request`

## Testing
- `node --test tests/*.test.mjs` (19 passed)
- `uv run --extra dev pytest tests/test_codex_auth_plugin_setup.py -q`
(6 passed)
- `npx prettier --check
packages/sandbox-runtime/src/sandbox_runtime/plugins/codex-auth-plugin.js
packages/sandbox-runtime/tests/codex-auth-plugin.test.mjs`
- `git diff --check`

---
*Created with
[Open-Inspect](https://open-inspect-prod.vercel.app/session/e0f189f3c5f4602c3e3cab2b983e7587)*

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

- **Bug Fixes**
  - Improved authentication handling for proxied API requests.
- Preserved caller-provided authorization credentials for non-OAuth
requests.
- Ensured OAuth requests use refreshed credentials and account
information correctly.
- Preserved request methods, custom headers, and request bodies when
routing requests through the proxy.

- **Tests**
- Added coverage for OAuth credential replacement and request rewriting.
- Verified non-OAuth requests retain their original authorization
headers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cole Murray <2492022+ColeMurray@users.noreply.github.com>
Co-authored-by: waclaude <colemurray.cs+ghwaclaude@gmail.com>
Conflict markers committed. Resolve them in this PR before merging.
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Terraform Validation Results

Step Status
Format
Init
Validate
Tests

Pushed by: @NicolasWalter, Action: pull_request

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Terraform Plan Results

Status: ✅ Success

Show Plan
terraform_data.access_control_gate: Refreshing state... [id=841ab6bc-98a7-018c-1031-ebad4f8b62bc]
terraform_data.cloudflare_custom_domain_gate: Refreshing state... [id=fa456fac-6c14-16e4-a484-3338d1a3718d]
terraform_data.sign_in_provider_gate: Refreshing state... [id=7f4a67d1-6978-0b23-899d-c2a9004643bd]
local_file.web_app_wrangler_production[0]: Refreshing state... [id=71b0d3758fc7d34e75fd9a3abe59e2c1b6dadeea]
null_resource.linear_bot_build[0]: Refreshing state... [id=956366907826137814]
module.modal_app[0].null_resource.modal_secrets[0]: Refreshing state... [id=8757687985279342629]
null_resource.github_bot_build[0]: Refreshing state... [id=8271231830927734747]
null_resource.slack_bot_build[0]: Refreshing state... [id=5379137651876318417]
null_resource.web_app_cloudflare_build[0]: Refreshing state... [id=5024517857365059396]
null_resource.control_plane_build: Refreshing state... [id=9105849033611783886]
cloudflare_r2_bucket.media: Refreshing state... [id=open-inspect-media-primo]
cloudflare_queue.image_build_finalization_dlq: Refreshing state... [id=cbbc2d8794c04396a550996e7f0cc129]
cloudflare_queue.slack_completion_delivery[0]: Refreshing state... [id=56ef0f3e13bd46a3a39f30c79ec547fa]
module.github_kv[0].cloudflare_workers_kv_namespace.this: Refreshing state... [id=87dbfaa1d9ce4a37a42e04c57c434a72]
cloudflare_d1_database.main: Refreshing state... [id=dba95b03-ace9-47a8-81e9-6e39d8d694c5]
random_bytes.provider_accounts_encryption_key: Refreshing state...
module.linear_kv[0].cloudflare_workers_kv_namespace.this: Refreshing state... [id=d003f1ad81384910a1f48a0a33f18c09]
module.slack_kv[0].cloudflare_workers_kv_namespace.this: Refreshing state... [id=729b357dbb5e4c9d99ec9212cc45766e]
data.external.modal_source_hash[0]: Reading...
cloudflare_queue.slack_completion_delivery_dlq[0]: Refreshing state... [id=06ce03d2663f4aea937b0c0c1c379c17]
random_password.service_auth_secret_web: Refreshing state... [id=none]
random_password.service_auth_secret_github_bot: Refreshing state... [id=none]
module.session_index_kv.cloudflare_workers_kv_namespace.this: Refreshing state... [id=7f18644fbed34121bbe3a196f373ea93]
data.external.modal_source_hash[0]: Read complete after 1s [id=-]
cloudflare_queue.image_build_finalization: Refreshing state... [id=1ca823a150c54578a9ad1814325147a3]
random_password.service_auth_secret_slack_bot: Refreshing state... [id=none]
random_password.service_auth_secret_linear_bot: Refreshing state... [id=none]
random_password.image_callback_token_pepper: Refreshing state... [id=none]
module.modal_app[0].null_resource.modal_deploy: Refreshing state... [id=5768192879312552892]
module.slack_bot_worker[0].cloudflare_worker.this: Refreshing state... [id=5200e96d69804ea296e1f3a6b39e4243]
module.linear_bot_worker[0].cloudflare_worker.this: Refreshing state... [id=33782d80e8ff4af9b30b92870084b674]
null_resource.d1_migrations: Refreshing state... [id=5980374278680462129]
module.slack_bot_worker[0].cloudflare_worker_version.this: Refreshing state... [id=e87b85ce-d5a2-4b3a-8fbe-23e6200e98fe]
module.linear_bot_worker[0].cloudflare_worker_version.this: Refreshing state... [id=a55bcc0f-a65c-41a5-8441-05d7b4af3966]
module.linear_bot_worker[0].cloudflare_workers_deployment.this: Refreshing state... [id=6986a9e1-4d49-41fa-a780-f4ad5e481b34]
module.slack_bot_worker[0].cloudflare_workers_deployment.this: Refreshing state... [id=ba95e23c-c5c2-40d9-a17e-823adba5df2a]
module.control_plane_worker.cloudflare_worker.this: Refreshing state... [id=c208a60c393e45e38eb502346bb7ce1e]
cloudflare_queue_consumer.slack_completion_delivery[0]: Refreshing state...
module.control_plane_worker.cloudflare_worker_version.this: Refreshing state... [id=e480d777-f058-4246-86ef-dc36a6fa28fe]
module.control_plane_worker.cloudflare_workers_deployment.this: Refreshing state... [id=6edc103c-bb0f-471e-8224-9f17597d658a]
module.control_plane_worker.cloudflare_workers_cron_trigger.this[0]: Refreshing state... [id=open-inspect-control-plane-primo]
null_resource.web_app_cloudflare_deploy[0]: Refreshing state... [id=1320732786606345683]
cloudflare_queue_consumer.image_build_finalization: Refreshing state...
module.github_bot_worker[0].cloudflare_worker.this: Refreshing state... [id=4b5e2696491a41eaaa124f4e2a9855f2]
null_resource.web_app_cloudflare_secrets[0]: Refreshing state... [id=8867783181576424643]
module.github_bot_worker[0].cloudflare_worker_version.this: Refreshing state... [id=21ef4d5d-ec56-47a1-8646-dbfcd4af510b]
module.github_bot_worker[0].cloudflare_workers_deployment.this: Refreshing state... [id=0a0e290a-7d4b-42f1-a5e0-49385187b3c5]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # cloudflare_queue.github_autofix[0] will be created
  + resource "cloudflare_queue" "github_autofix" {
      + account_id            = "bf66240843ed90d19b82e4b90916d29a"
      + consumers             = (known after apply)
      + consumers_total_count = (known after apply)
      + created_on            = (known after apply)
      + id                    = (known after apply)
      + modified_on           = (known after apply)
      + producers             = (known after apply)
      + producers_total_count = (known after apply)
      + queue_id              = (known after apply)
      + queue_name            = "open-inspect-github-autofix-primo"
      + settings              = (known after apply)
    }

  # cloudflare_queue.github_autofix_dlq[0] will be created
  + resource "cloudflare_queue" "github_autofix_dlq" {
      + account_id            = "bf66240843ed90d19b82e4b90916d29a"
      + consumers             = (known after apply)
      + consumers_total_count = (known after apply)
      + created_on            = (known after apply)
      + id                    = (known after apply)
      + modified_on           = (known after apply)
      + producers             = (known after apply)
      + producers_total_count = (known after apply)
      + queue_id              = (known after apply)
      + queue_name            = "open-inspect-github-autofix-dlq-primo"
      + settings              = (known after apply)
    }

  # cloudflare_queue_consumer.github_autofix[0] will be created
  + resource "cloudflare_queue_consumer" "github_autofix" {
      + account_id        = "bf66240843ed90d19b82e4b90916d29a"
      + consumer_id       = (known after apply)
      + created_on        = (known after apply)
      + dead_letter_queue = "open-inspect-github-autofix-dlq-primo"
      + queue_id          = (known after apply)
      + queue_name        = (known after apply)
      + script_name       = "open-inspect-control-plane-primo"
      + settings          = {
          + batch_size            = 1
          + max_concurrency       = 5
          + max_retries           = 4
          + max_wait_time_ms      = 1000
          + retry_delay           = 30
          + visibility_timeout_ms = (known after apply)
        }
      + type              = "worker"
    }

  # local_file.web_app_wrangler_production[0] will be created
  + resource "local_file" "web_app_wrangler_production" {
      + content              = <<-EOT
            name = "open-inspect-web-primo"
            main = ".open-next/worker.js"
            compatibility_date = "2025-08-15"
            compatibility_flags = ["nodejs_compat", "global_fetch_strictly_public"]
            
            # A custom-domain deployment has one canonical browser origin.
            workers_dev = true
            
            [vars]
            CONTROL_PLANE_URL = "https://open-inspect-control-plane-primo.primo-bf6.workers.dev"
            NEXT_PUBLIC_WS_URL = "wss://open-inspect-control-plane-primo.primo-bf6.workers.dev"
            NEXT_PUBLIC_SANDBOX_PROVIDER = "modal"
            NEXT_PUBLIC_APP_NAME = "Primo"
            NEXT_PUBLIC_APP_ICON_URL = ""
            
            [assets]
            directory = ".open-next/assets"
            binding = "ASSETS"
            
            [[services]]
            binding = "CONTROL_PLANE_WORKER"
            service = "open-inspect-control-plane-primo"
        EOT
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../../..//packages/web/wrangler.production.toml"
      + id                   = (known after apply)
    }

  # null_resource.control_plane_build must be replaced
-/+ resource "null_resource" "control_plane_build" {
      ~ id       = "9105849033611783886" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "always_run" = "2026-08-26T12:04:31Z" -> (known after apply)
        }
    }

  # null_resource.d1_migrations must be replaced
-/+ resource "null_resource" "d1_migrations" {
      ~ id       = "5980374278680462129" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "migrations_sha" = "177eee0e2901d7ed13c268ff3734192a648a7c7ed0f08db7d5568f5277847087" -> "5f840c6ba6171045d35df0170478fbacf4a13d6e5c039e405f8a8bac9b29b191"
            # (1 unchanged element hidden)
        }
    }

  # null_resource.github_bot_build[0] must be replaced
-/+ resource "null_resource" "github_bot_build" {
      ~ id       = "8271231830927734747" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "always_run" = "2026-08-26T12:04:31Z" -> (known after apply)
        }
    }

  # null_resource.linear_bot_build[0] must be replaced
-/+ resource "null_resource" "linear_bot_build" {
      ~ id       = "956366907826137814" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "always_run" = "2026-08-26T12:04:31Z" -> (known after apply)
        }
    }

  # null_resource.slack_bot_build[0] must be replaced
-/+ resource "null_resource" "slack_bot_build" {
      ~ id       = "5379137651876318417" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "always_run" = "2026-08-26T12:04:31Z" -> (known after apply)
        }
    }

  # null_resource.web_app_cloudflare_build[0] must be replaced
-/+ resource "null_resource" "web_app_cloudflare_build" {
      ~ id       = "5024517857365059396" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "always_run" = "2026-08-26T12:04:31Z" -> (known after apply)
        }
    }

  # null_resource.web_app_cloudflare_deploy[0] must be replaced
-/+ resource "null_resource" "web_app_cloudflare_deploy" {
      ~ id       = "1320732786606345683" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "always_run" = "2026-08-26T12:05:09Z" -> (known after apply)
        }
    }

  # module.control_plane_worker.cloudflare_worker.this will be updated in-place
  ~ resource "cloudflare_worker" "this" {
        id             = "c208a60c393e45e38eb502346bb7ce1e"
        name           = "open-inspect-control-plane-primo"
      ~ observability  = {
          ~ logs               = {
              + destinations       = (known after apply)
                # (4 unchanged attributes hidden)
            }
          ~ traces             = {
              + destinations       = (known after apply)
                # (3 unchanged attributes hidden)
            }
            # (2 unchanged attributes hidden)
        }
      ~ references     = {
          ~ dispatch_namespace_outbounds = [] -> (known after apply)
          ~ domains                      = [] -> (known after apply)
          ~ durable_objects              = [
              - {
                  - namespace_id   = "4c77239db3614a6aac69a90e1fbd8955" -> null
                  - namespace_name = "open-inspect-control-plane-primo_SessionDO" -> null
                  - worker_id      = "c208a60c393e45e38eb502346bb7ce1e" -> null
                  - worker_name    = "open-inspect-control-plane-primo" -> null
                },
            ] -> (known after apply)
          ~ queues                       = [
              - {
                  - queue_consumer_id = "648d35d2a8064e8ea79899e946a65334" -> null
                  - queue_id          = "1ca823a150c54578a9ad1814325147a3" -> null
                  - queue_name        = "open-inspect-image-build-finalization-primo" -> null
                },
            ] -> (known after apply)
          ~ workers                      = [
              - {
                  - id   = "ac07332f8b0f4cdfa4ca04f966a9fa61" -> null
                  - name = "open-inspect-web-primo" -> null
                },
              - {
                  - id   = "4b5e2696491a41eaaa124f4e2a9855f2" -> null
                  - name = "open-inspect-github-bot-primo" -> null
                },
              - {
                  - id   = "33782d80e8ff4af9b30b92870084b674" -> null
                  - name = "open-inspect-linear-bot-primo" -> null
                },
              - {
                  - id   = "5200e96d69804ea296e1f3a6b39e4243" -> null
                  - name = "open-inspect-slack-bot-primo" -> null
                },
            ] -> (known after apply)
        } -> (known after apply)
        tags           = []
      ~ updated_on     = "2026-08-26T12:04:33Z" -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # module.control_plane_worker.cloudflare_worker_version.this must be replaced
-/+ resource "cloudflare_worker_version" "this" {
      ~ annotations         = {
          + workers_message      = (known after apply)
          + workers_tag          = (known after apply)
          ~ workers_triggered_by = "create_version_api" -> (known after apply)
        } -> (known after apply)
      ~ bindings            = (sensitive value) # forces replacement
      ~ created_on          = "2026-08-26T12:04:38Z" -> (known after apply)
      ~ id                  = "e480d777-f058-4246-86ef-dc36a6fa28fe" -> (known after apply)
      + limits              = (known after apply)
      + main_script_base64  = (known after apply)
      ~ migration_tag       = "v1" -> (known after apply)
      ~ modules             = [
          - { # forces replacement
              - content_file   = "../../..//packages/control-plane/dist/index.js" -> null
              - content_sha256 = "4ac20254b2f6c06558a76dfc57261274427cf88b501a0f3645025100bee072e6" -> null
              - content_type   = "application/javascript+module" -> null
              - name           = "index.js" -> null
            },
          + { # forces replacement
              + content_file   = "../../..//packages/control-plane/dist/index.js"
              + content_sha256 = "1cdf667bb4fae93714ca8c68bc44ad14b7caa9b05574660eefe58e98caf183ff"
              + content_type   = "application/javascript+module"
              + name           = "index.js"
            },
        ]
      ~ number              = 65 -> (known after apply)
      ~ source              = "terraform" -> (known after apply)
      ~ startup_time_ms     = 124 -> (known after apply)
      ~ urls                = [] -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # module.control_plane_worker.cloudflare_workers_deployment.this must be replaced
-/+ resource "cloudflare_workers_deployment" "this" {
      ~ annotations  = {
          + workers_message      = (known after apply)
          ~ workers_triggered_by = "deployment" -> (known after apply)
        } -> (known after apply)
      ~ author_email = "nicolas@primo.la" -> (known after apply)
      ~ created_on   = "2026-08-26T12:04:40Z" -> (known after apply)
      ~ id           = "6edc103c-bb0f-471e-8224-9f17597d658a" -> (known after apply)
      ~ source       = "terraform" -> (known after apply)
      ~ versions     = [ # forces replacement
          ~ {
              ~ version_id = "e480d777-f058-4246-86ef-dc36a6fa28fe" -> (known after apply)
                # (1 unchanged attribute hidden)
            },
        ]
        # (3 unchanged attributes hidden)
    }

  # module.github_bot_worker[0].cloudflare_worker.this will be updated in-place
  ~ resource "cloudflare_worker" "this" {
        id             = "4b5e2696491a41eaaa124f4e2a9855f2"
        name           = "open-inspect-github-bot-primo"
      ~ observability  = {
          ~ logs               = {
              + destinations       = (known after apply)
                # (4 unchanged attributes hidden)
            }
          ~ traces             = {
              + destinations       = (known after apply)
                # (3 unchanged attributes hidden)
            }
            # (2 unchanged attributes hidden)
        }
      ~ references     = {
          ~ dispatch_namespace_outbounds = [] -> (known after apply)
          ~ domains                      = [] -> (known after apply)
          ~ durable_objects              = [] -> (known after apply)
          ~ queues                       = [] -> (known after apply)
          ~ workers                      = [] -> (known after apply)
        } -> (known after apply)
        tags           = []
      ~ updated_on     = "2026-08-26T12:04:40Z" -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # module.github_bot_worker[0].cloudflare_worker_version.this must be replaced
-/+ resource "cloudflare_worker_version" "this" {
      ~ annotations         = {
          + workers_message      = (known after apply)
          + workers_tag          = (known after apply)
          ~ workers_triggered_by = "create_version_api" -> (known after apply)
        } -> (known after apply)
      ~ bindings            = (sensitive value) # forces replacement
      ~ created_on          = "2026-08-26T12:04:41Z" -> (known after apply)
      ~ id                  = "21ef4d5d-ec56-47a1-8646-dbfcd4af510b" -> (known after apply)
      + limits              = (known after apply)
      + main_script_base64  = (known after apply)
      + migration_tag       = (known after apply)
      ~ modules             = [
          - { # forces replacement
              - content_file   = "../../..//packages/github-bot/dist/index.js" -> null
              - content_sha256 = "54510ead747ee6d78a3d7db31ac2cd9ffeeafb439c037df965ee7c51ccdeda05" -> null
              - content_type   = "application/javascript+module" -> null
              - name           = "index.js" -> null
            },
          + { # forces replacement
              + content_file   = "../../..//packages/github-bot/dist/index.js"
              + content_sha256 = "f393be551fbdebca7ca66941b06022d13050519c083e4ca6ca170694df75ae59"
              + content_type   = "application/javascript+module"
              + name           = "index.js"
            },
        ]
      ~ number              = 49 -> (known after apply)
      ~ source              = "terraform" -> (known after apply)
      ~ startup_time_ms     = 35 -> (known after apply)
      ~ urls                = [
          - "https://21ef4d5d-open-inspect-github-bot-primo.primo-bf6.workers.dev",
        ] -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # module.github_bot_worker[0].cloudflare_workers_deployment.this must be replaced
-/+ resource "cloudflare_workers_deployment" "this" {
      ~ annotations  = {
          + workers_message      = (known after apply)
          ~ workers_triggered_by = "deployment" -> (known after apply)
        } -> (known after apply)
      ~ author_email = "nicolas@primo.la" -> (known after apply)
      ~ created_on   = "2026-08-26T12:04:41Z" -> (known after apply)
      ~ id           = "0a0e290a-7d4b-42f1-a5e0-49385187b3c5" -> (known after apply)
      ~ source       = "terraform" -> (known after apply)
      ~ versions     = [ # forces replacement
          ~ {
              ~ version_id = "21ef4d5d-ec56-47a1-8646-dbfcd4af510b" -> (known after apply)
                # (1 unchanged attribute hidden)
            },
        ]
        # (3 unchanged attributes hidden)
    }

  # module.linear_bot_worker[0].cloudflare_worker.this will be updated in-place
  ~ resource "cloudflare_worker" "this" {
        id             = "33782d80e8ff4af9b30b92870084b674"
        name           = "open-inspect-linear-bot-primo"
      ~ observability  = {
          ~ logs               = {
              + destinations       = (known after apply)
                # (4 unchanged attributes hidden)
            }
          ~ traces             = {
              + destinations       = (known after apply)
                # (3 unchanged attributes hidden)
            }
            # (2 unchanged attributes hidden)
        }
      ~ references     = {
          ~ dispatch_namespace_outbounds = [] -> (known after apply)
          ~ domains                      = [] -> (known after apply)
          ~ durable_objects              = [] -> (known after apply)
          ~ queues                       = [] -> (known after apply)
          ~ workers                      = [
              - {
                  - id   = "c208a60c393e45e38eb502346bb7ce1e" -> null
                  - name = "open-inspect-control-plane-primo" -> null
                },
            ] -> (known after apply)
        } -> (known after apply)
        tags           = []
      ~ updated_on     = "2026-08-26T12:04:32Z" -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # module.linear_bot_worker[0].cloudflare_worker_version.this must be replaced
-/+ resource "cloudflare_worker_version" "this" {
      ~ annotations         = {
          + workers_message      = (known after apply)
          + workers_tag          = (known after apply)
          ~ workers_triggered_by = "create_version_api" -> (known after apply)
        } -> (known after apply)
      ~ bindings            = (sensitive value) # forces replacement
      ~ created_on          = "2026-08-26T12:04:32Z" -> (known after apply)
      ~ id                  = "a55bcc0f-a65c-41a5-8441-05d7b4af3966" -> (known after apply)
      + limits              = (known after apply)
      + main_script_base64  = (known after apply)
      + migration_tag       = (known after apply)
      ~ modules             = [
          - { # forces replacement
              - content_file   = "../../..//packages/linear-bot/dist/index.js" -> null
              - content_sha256 = "cdd5ab4993778450482ea7956889b7ffd9de4c45960b12976b384f16b5b539bf" -> null
              - content_type   = "application/javascript+module" -> null
              - name           = "index.js" -> null
            },
          + { # forces replacement
              + content_file   = "../../..//packages/linear-bot/dist/index.js"
              + content_sha256 = "9bd8cb92da52855c87a45f7bda24f881aa27cb7d42c23e8e8d78aead95354116"
              + content_type   = "application/javascript+module"
              + name           = "index.js"
            },
        ]
      ~ number              = 68 -> (known after apply)
      ~ source              = "terraform" -> (known after apply)
      ~ startup_time_ms     = 42 -> (known after apply)
      ~ urls                = [
          - "https://a55bcc0f-open-inspect-linear-bot-primo.primo-bf6.workers.dev",
        ] -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # module.linear_bot_worker[0].cloudflare_workers_deployment.this must be replaced
-/+ resource "cloudflare_workers_deployment" "this" {
      ~ annotations  = {
          + workers_message      = (known after apply)
          ~ workers_triggered_by = "deployment" -> (known after apply)
        } -> (known after apply)
      ~ author_email = "nicolas@primo.la" -> (known after apply)
      ~ created_on   = "2026-08-26T12:04:33Z" -> (known after apply)
      ~ id           = "6986a9e1-4d49-41fa-a780-f4ad5e481b34" -> (known after apply)
      ~ source       = "terraform" -> (known after apply)
      ~ versions     = [ # forces replacement
          ~ {
              ~ version_id = "a55bcc0f-a65c-41a5-8441-05d7b4af3966" -> (known after apply)
                # (1 unchanged attribute hidden)
            },
        ]
        # (3 unchanged attributes hidden)
    }

  # module.modal_app[0].null_resource.modal_deploy must be replaced
-/+ resource "null_resource" "modal_deploy" {
      ~ id       = "5768192879312552892" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "source_hash"       = "7dea31102eed27234e88e6b28e35595256d20715e6ae85a373d2dfd7edb707e3" -> "9b9b10e226266cccd65a8dd6e236c92d1baa75a22ec38fb5ba00f46be0984da6"
            # (3 unchanged elements hidden)
        }
    }

  # module.slack_bot_worker[0].cloudflare_worker.this will be updated in-place
  ~ resource "cloudflare_worker" "this" {
        id             = "5200e96d69804ea296e1f3a6b39e4243"
        name           = "open-inspect-slack-bot-primo"
      ~ observability  = {
          ~ logs               = {
              + destinations       = (known after apply)
                # (4 unchanged attributes hidden)
            }
          ~ traces             = {
              + destinations       = (known after apply)
                # (3 unchanged attributes hidden)
            }
            # (2 unchanged attributes hidden)
        }
      ~ references     = {
          ~ dispatch_namespace_outbounds = [] -> (known after apply)
          ~ domains                      = [] -> (known after apply)
          ~ durable_objects              = [] -> (known after apply)
          ~ queues                       = [
              - {
                  - queue_consumer_id = "a755a290fd92417fb11c298f9c1d1f40" -> null
                  - queue_id          = "56ef0f3e13bd46a3a39f30c79ec547fa" -> null
                  - queue_name        = "open-inspect-slack-completion-primo" -> null
                },
            ] -> (known after apply)
          ~ workers                      = [
              - {
                  - id   = "c208a60c393e45e38eb502346bb7ce1e" -> null
                  - name = "open-inspect-control-plane-primo" -> null
                },
            ] -> (known after apply)
        } -> (known after apply)
        tags           = []
      ~ updated_on     = "2026-08-26T12:04:31Z" -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # module.slack_bot_worker[0].cloudflare_worker_version.this must be replaced
-/+ resource "cloudflare_worker_version" "this" {
      ~ annotations         = {
          + workers_message      = (known after apply)
          + workers_tag          = (known after apply)
          ~ workers_triggered_by = "create_version_api" -> (known after apply)
        } -> (known after apply)
      ~ bindings            = (sensitive value) # forces replacement
      ~ created_on          = "2026-08-26T12:04:32Z" -> (known after apply)
      ~ id                  = "e87b85ce-d5a2-4b3a-8fbe-23e6200e98fe" -> (known after apply)
      + limits              = (known after apply)
      + main_script_base64  = (known after apply)
      + migration_tag       = (known after apply)
      ~ modules             = [
          - { # forces replacement
              - content_file   = "../../..//packages/slack-bot/dist/index.js" -> null
              - content_sha256 = "6911837e8156b867d1069efd3fbac032f460149d1226b260fddb6d37d5233cee" -> null
              - content_type   = "application/javascript+module" -> null
              - name           = "index.js" -> null
            },
          + { # forces replacement
              + content_file   = "../../..//packages/slack-bot/dist/index.js"
              + content_sha256 = "76d159e773b5ece07e2f37e284d624ec56ee143f4309f0efe6408c5f2a1f2f10"
              + content_type   = "application/javascript+module"
              + name           = "index.js"
            },
        ]
      ~ number              = 71 -> (known after apply)
      ~ source              = "terraform" -> (known after apply)
      ~ startup_time_ms     = 99 -> (known after apply)
      ~ urls                = [
          - "https://e87b85ce-open-inspect-slack-bot-primo.primo-bf6.workers.dev",
        ] -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # module.slack_bot_worker[0].cloudflare_workers_deployment.this must be replaced
-/+ resource "cloudflare_workers_deployment" "this" {
      ~ annotations  = {
          + workers_message      = (known after apply)
          ~ workers_triggered_by = "deployment" -> (known after apply)
        } -> (known after apply)
      ~ author_email = "nicolas@primo.la" -> (known after apply)
      ~ created_on   = "2026-08-26T12:04:33Z" -> (known after apply)
      ~ id           = "ba95e23c-c5c2-40d9-a17e-823adba5df2a" -> (known after apply)
      ~ source       = "terraform" -> (known after apply)
      ~ versions     = [ # forces replacement
          ~ {
              ~ version_id = "e87b85ce-d5a2-4b3a-8fbe-23e6200e98fe" -> (known after apply)
                # (1 unchanged attribute hidden)
            },
        ]
        # (3 unchanged attributes hidden)
    }

Plan: 20 to add, 4 to change, 16 to destroy.

Changes to Outputs:
  + d1_database_name               = "open-inspect-primo"
  + slack_bot_events_url           = "https://open-inspect-slack-bot-primo.primo-bf6.workers.dev/events"
  + slack_bot_interactions_url     = "https://open-inspect-slack-bot-primo.primo-bf6.workers.dev/interactions"
  + slack_bot_worker_url           = "https://open-inspect-slack-bot-primo.primo-bf6.workers.dev"

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan"

Pushed by: @NicolasWalter

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.

4 participants