Repository navigation
Accelerate - #2030
Merged
Merged
Accelerate#2030
Conversation
## Why
When a person sends a WhatsApp photo, video or document with a caption
("Is this tooth chipped?" + photo), they get no reply. `whatsapp.yaml`
revision 1 reads only `type: text` (`messages.match`) and takes its
words from `text.body`. Meta sends a photo as `{"type": "image",
"image": {"caption", "mime_type", "sha256", "id", "url"}}` ([image
messages webhook
reference](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/reference/messages/image));
a video and a document carry the same `caption`, "Media asset caption
text"
([video](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/reference/messages/video),
[document](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/reference/messages/document)).
So the whole message is skipped as `match …type`.
A manifest-only fix is not possible. `match` compares exact strings
(`core/channel.go`, `MessageRule.read`), and `text` is one path, so a
manifest cannot say "text from `text.body`, or a photo from
`image.caption`". The smallest core change is `messages.also`: other
kinds of message, each with its own `match` and `text`.
## How it works
```
a message of the delivery
├─ has match (type: text) -> read, text = text.body (as revision 1)
└─ differs from match
└─ first also entry whose match it has (type: image | video | document)
├─ its text (<kind>.caption) is a non-empty value -> read, text = caption
└─ none, "" or unreadable (an object) -> skipped "match …type" (as before)
```
The caption reaches the bridge as a text message would: `Text` set, no
`Media`. Keywords, thread channels, cards and the message hook's
empty-text checks therefore treat it as the same words sent as text.
```
POST /v1/connectors/events/whatsapp/{app} reads with the LATEST revision (connector_events.go)
-> channelbridge.take reads again with the connection's PINNED revision
revision 2: photo + caption -> thread message -> agent -> reply
revision 1: photo not found -> dropped, info log (new: errNotRead)
```
Without the drop, a connection still on revision 1 answers 500 to a
captioned photo, on every retry.
`TestAConnectionStillOnRevision1AnswersTextAlone` failed that way before
the bridge change.
| Case | Revision 1 / base | Revision 2 |
|---|---|---|
| text "First" | read | read, same values (control: base probe of
`whatsapp.kinds.json` on 43159cc) |
| photo / video / document + caption | dropped | read, text = caption,
no file |
| photo + caption "STOP" | dropped | the STOP keyword: confirmation,
opt-out, no agent |
| photo / video / document without caption / `caption: ""` | dropped |
dropped |
| reaction, sticker, audio, location, button, interactive, unsupported,
statuses | dropped | dropped |
| connection pinned to revision 1 | — | photo, video and document
dropped with a log line, text beside it answered |
| rollback build reading the stored revision 2 | — | ignores `also`
(jsonb → encoding/json drops unknown keys), reads text only |
## Changes
- `core.MessageRule.Also` (`[]MessageKind{Match, Text}`) and `mismatch`.
`Validate` requires `messages.match`, a non-empty entry `match` with
values, and an entry `text` that is a path the message's `each` binds.
- `whatsapp.yaml` revision 2: `also`: three entries, `type image` ->
`image.caption`, `type video` -> `video.caption`, `type document` ->
`document.caption`. `match: type text` and `text.body` stay, so a
rollback still reads revision 1 behaviour.
- `channelbridge.take`: drops a message that the connection's pinned
revision does not read (`errNotRead`) instead of returning an error.
- AGENTS.md (core, channelbridge) and CHANGELOG.
Out of scope: the photo file itself. Its id and url are downloaded with
the access token, which is AI-2740.
## Validation
- `go test ./internal/store ./internal/connectors/...
./internal/channelbridge`: pass. Goldens
(`TestTheBaseBuiltInsMarshalAsTheyWereStored`) are unchanged: `also` is
`omitempty`.
- Integration, on this branch merged onto accelerate 03c0645:
`TestWhatsAppChannelSuite`, `TestEventForwardingSuite`,
`./internal/channelbridge` and the `TestStoreSuite` seeding and
definition tests all pass.
- New tests:
- `TestAPhotoWithACaptionIsAnsweredAsItsCaption`: the caption reaches
the model and the reply is sent.
- `TestAVideoOrADocumentWithACaptionIsAnsweredAsItsCaption`: each kind
is stored as its caption, with no file, and answered.
- `TestAPhotoCaptionedStopIsTheKeyword`.
- `TestAPhotoWithoutACaptionAndOtherKindsAreNotWritten` (a photo, video
or document with no caption or an empty one among them): nothing is
linked or sent, and no card opens.
- `TestAConnectionStillOnRevision1AnswersTextAlone`.
- Core table `TestAlsoReadsAnotherKindByItsOwnText` (14 shapes), plus
`TestTheFirstAlsoEntryThatMatchesReadsTheMessage`,
`TestAnAlsoMatchThatCannotBeReadIsNotTheKind`,
`TestAMessageAlsoCannotReadLeavesTheBatchRead` and
`TestAlsoIsCheckedWhenTheManifestIsParsed`.
- Providers: `TestAPhotoIsReadByItsCaptionAndNothingElseNew` (control
values from a base probe) and
`TestABuildWithoutAlsoReadsRevision2AsRevision1`.
- Mutation checks: 19 unit mutations and 5 integration mutations on the
image entry, all killed except one; for the video and the document entry
each, 3 unit mutations (entry removed, `match` changed, `text` changed)
and an endpoint mutation (entry removed), all killed. That mutation lets
a non-image message carrying `image.caption` through: the core table
kills it, but no real Meta payload has that shape, so the endpoint tests
miss it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
`router replicate --once` starts each run with a full copy
(`acceleration/cmd/router/replicate.go:104`). That copy upserts each
connector connection by id over the destination's row. The import forces
`status = needs_reauthorization`, `credentials_kek_version = 0` and
`expires_at = NULL`, and takes the source's `revision`
(`dataTable.identity`, `internal/store/datamove.go`). The destination's
`credentials_sealed` is not written, so it stays. But its key version is
now 0, which means "no credentials". A connection the owner authorized
again on the destination is broken by the next catch-up copy. This
happened during an app move.
## How it works
```
importRow(connector_connections row) ImportRow and ApplyChanges
INSERT ... ON CONFLICT (id) DO UPDATE SET ...
WHERE destination row is the customer's
AND destination row status <> 'connected' <- new
├─ no row here -> inserted, needs_reauthorization (as before)
├─ row here, not connected -> updated from the source (as before)
└─ row here, connected -> left as it is: status, revision,
key version, expiry, sealed credentials
```
Both production paths go through `importRow`. The full copy goes through
`ImportRow` (`replicate.go:199`, `POST /v1/data/import`). The changes
replay goes through `ApplyChanges` (`replicate.go:250`,
`/v1/data/import` change lines). So one guard covers both.
The rule is "never overwrite a connected destination row", not "skip
when the destination's `updated_at` is newer". During a move the source
is still live. A token refresh there saves new credentials and moves the
source's `updated_at` past the destination's, so the `updated_at` rule
would break the connection again on the next copy. The tests below do
this refresh on the source.
| Case | Before | After | Test |
|---|---|---|---|
| Copied, authorized again here, source refreshed, copied again |
`needs_reauthorization`, key version 0, no expiry | `connected`, the
saved revision, key version, expiry and sealed credentials |
`TestCopyingAgainKeepsAConnectionAuthorizedAgainOnTheDestination` |
| Same, the source's changes replayed | same as above | same as above |
`TestAChangeAppliedLaterKeepsAConnectionAuthorizedAgainOnTheDestination`
|
| Copied, not authorized here, renamed at source, copied again |
`needs_reauthorization`, renamed | unchanged |
`TestCopyingAgainStillUpdatesAConnectionNotAuthorizedOnTheDestination`
(control, passes on base) |
## Trade-off
A connection connected here (key version above 0, which only a seal here
sets) keeps its row entirely. A rename, a disconnect or a soft delete at
the source no longer reaches it; a hard delete still does. Chosen over
merging fields: the credentials open only at the revision and key
version they were sealed under, so a partial update of the row would
break them.
- Round 1: the guard also requires key version 0, so an import cannot
land while a refresh on the destination has checkpointed the row as
needing reauthorization
(`TestCopyingAgainDuringARefreshOnTheDestinationKeepsItsCredentials`,
fails without the clause).
## Validation
- Store `TestDataMoveSuite` (in parts of 25 tests, see below) and api
`TestDataMoveSuite`, each against its own Postgres.
- Both keep-tests fail on base: status `needs_reauthorization`, key
version 0, expiry nil. The control passes on base.
- Mutations, each failing a named test: the guard removed; `DO NOTHING`
for every connection; `status = 'connected'`; `needs_reauthorization` in
place of `connected`; the guard on another table.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#1733) ## Why Five parallel agents put the laptop at load 77. The Docker VM was swapping: 52% sys, 15% iowait, 776 MB free of 12 GB. ``` before after Docker VM Docker VM ├─ ai2133-pg (fsync on) ├─ va-test-pg (fsync off, one server) ├─ fr-ai2656-pg (fsync on) │ ├─ model_router_test_ai2133_test ├─ dr-ai2656-pg (fsync on) │ ├─ model_router_test_fr_ai2656_test ├─ … 8 servers │ └─ … └─ one redis each └─ one redis each (unchanged) ``` ## What changes in `parallel-agents` | Rule | Before | After | |---|---|---| | Test Postgres | one container per agent | one shared server with fsync off, a database per agent | | Redis | one per agent | one per agent: the router's Redis config has no database number or key prefix | | CI | "CI does not run `-tags integration`" | `Integration (router)` runs the packages in its matrix on a PR that changes `acceleration/**` (not only `.md`), `go.work`, `go.work.sum` or the workflow; don't repeat them locally; `campaign`, `phone/outcome`, `searchrouter`, `simulation`, `imagerouter`, `dlc` and the vendor suites stay by hand | ## Checked - `TestStoreSuite` on the shared server: 810 pass, 2 fail. - Both failures are timing tests and fail on a default-config Postgres too. `TestLiveGrantsLeaveOutRevokedAndExpired` failed 1/6 on the shared server and 2/6 on a control with fsync on, under the same load. Docs only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
Stream's proxy in front of the router requires `?api_key=<app key>` on
every public call and forwards it unchanged. The router's own
`auth.credentials` also reads `?api_key=` as the credential when no
`X-Api-Key` header is sent (`internal/auth/auth.go:604-617`). Five
operations read a query parameter with the same name as a filter or as a
subject id. So through the proxy each one got the caller's own key:
| Operation | Through the proxy, before |
| --- | --- |
| `listUsageEvents` (`account.go:160`) | lists only the caller key's
rows. Rows from `hook:chat`, `phone:inbound`, `job:<name>` or another
key never show. `api_key=hook%3Achat` gets the proxy's 401 |
| `getSpend` (`server.go:2334`) | sums only the caller key's spend. The
Volt dashboard's spend chart, which sends no key filter, is narrowed the
same way |
| `listLimits` (`limits.go:281`), `listLimitGrants` (`grants.go:128`) |
lists only the key-level rows of the caller's key |
| `getLimitUsage` (`limits.go:303`) | every subject except `api_key`
answers 400 "names no api_key" (`limits.go:634-639`) |
This is why AI-2684 found the sessionless voice note's STT row
"missing". The row was written and shipped, and the list hid it.
## How it works
```
GET /v1/usage/events?api_key=<app key>&api_key_id=hook:chat
│ │
│ └─ filter: rows started by hook:chat
└─ credential: the proxy and auth.credentials read it,
the operation ignores it
```
The filter or subject is now `api_key_id` on all five operations and on
their `manage*` twins. `api_key` in the query is only the credential.
**Why `api_key_id`:** the response field and `group_by=who:api_key` call
this value `api_key`. That name is taken: across Stream's APIs,
`api_key` in the query is the app's credential (Chat REST, Video, and
this proxy). The proxy already passes the same value to the router as
`X-Stream-Api-Key-Id` (`auth.APIKeyIDHeader`,
`internal/auth/auth.go:118`). Anthropic's usage report names the same
filter `api_key_ids` with `group_by=api_key_id`
([docs](https://platform.claude.com/docs/en/api/admin-api/usage-cost/get-messages-usage-report)),
and OpenAI's usage API does the same
([docs](https://developers.openai.com/api/reference/resources/organization/subresources/usage/methods/get_completions/index.md)).
Request bodies and response fields keep `api_key`, because the proxy
does not read bodies.
## Changes
- Router: renamed the query tags in `account.go`, `server.go`,
`limits.go` and `grants.go`, and updated the operation descriptions.
Regenerated `openapi.yaml`.
- Clients: regenerated Go, JS, Python (`plugins/stream`), Ruby and Rust.
Kotlin, Swift, Dart, .NET and PHP had no change (their generators'
`--check` passes, since these operations are server-side only).
`plugins/stream` keeps its Python `api_key=` argument and sends it as
`api_key_id`. The fake spend router in its tests reads `api_key_id`, as
the real router does.
- Docs: README, CHANGELOG (Breaking Changes), and a note in
`.claude/skills/sdk/SKILL.md` for the other SDKs.
## Validation
| Test | Catches |
| --- | --- |
|
`TestAccountSuite/TestUsageEventsWithTheCallersKeyInTheQueryListEveryKey`
| `api_key=<app key>` in the query (as the proxy sends it) narrows the
list. On base it lists 1 of 3 rows |
|
`TestUsageIdentitySuite/TestSpendWithTheCallersKeyInTheQueryCountsEveryKey`
| the same for spend, with a `hook:chat` row |
| `TestLimitsSuite/TestLimitsListWithTheCallersKeyInTheQuery`,
`TestGrantsListWithTheCallersKeyInTheQuery` | the limits and grants
lists are narrowed by the credential |
| `TestLimitsSuite/TestLimitUsageWithTheCallersKeyInTheQuery` | a user's
usage gets a 400 when the credential is present (it fails this way on
base). Also checks that a key subject is read from `api_key_id` and that
the refusal names `api_key_id` |
| `TestUsageEventsWithNoKeyInTheQueryListEveryKey`,
`TestSpendWithNoKeyInTheQueryCountsEveryKey` | controls: a call with no
key in the query answers as on base (both pass on base sources) |
| `plugins/stream` `test_*_sends_a_key_as_api_key_id` (list, grants,
usage, spend) | the Python wrappers send the key as `api_key` |
Mutation checks: 11 Go mutations (each tag reverted, each filter
dropped, the usage subject id dropped, the refusal label) and 2 Python
mutations. Each one fails a test.
Touched suites pass on the branch merged with `accelerate`: Account,
SelfHostedAccount, UsageIdentity, ShippedUsage, ProxiedUsage, Limits,
the `internal/api` unit tests, `plugins/stream` (548 passed), Ruby
`rake`, Rust `cargo test` and the JS typecheck.
**Merge order:** this PR must merge after the Volt PR that sends
`api_key_id` beside `api_key`: GetStream/volt-dashboard#1197 (merged).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…1727) ## What A session the person's own app opens with **their user token** now starts with their episode cards. It reads them exactly as the app chat's session does: same Stream user, same Stream app, same agent config. Ticket: AI-2709. ``` Anya (anya_123) in the app chat: "my appointment is Friday at 3" └─ api.chatEpisode ─► card (source chat) in omni-channel of stream_user:<app>:anya_123 Later, Anya taps "Talk to assistant" (her own token): POST /v1/agents/sessions (api/session_create.go:52-53) spec.Caller = CallerFrom(ctx), spec.CallerKind = KindFrom(ctx) (api/server.go:1160-1165) └─ session.Manager.Create ─► callCards.read (session/manager.go:874) deviceCaller(spec)? CallerKind authenticated, Caller.UserID set, not ServerSide checksTokens? Stream says the app checks tokens (Readiness.AuthChecksOff false) └─ omnichannel.Cards.Context(Reading{User: anya_123, Own: <its conversation>}) deviceContact ─► StreamUser(app, anya_123) ─► store.Contact ─► samePin model context: system note + her card ``` ## Who is "verified" | Caller (how the credential made it) | Kind | Reads her cards | |---|---|---| | Anya's token, signed with the app secret (`auth.keyed`, auth.go:418-425) or vouched by the gateway (`auth.proxied`) | authenticated | yes | | Bob's token | authenticated (bob) | Bob's only | | Guest token naming her (`role: guest`) | guest | no | | Anonymous caller going by her name (auth.go:466-469) | anonymous | no | | Backend, alone or naming her (`X-Stream-User-Id`) | server | no | | Scheduled task / worker session (`Caller.ServerSide`) | any | no | | Any caller in a Stream app with **auth checks off**, or one Stream can't be asked about | — | no | **Auth checks off.** Stream accepts unsigned tokens (dev tokens) when an app's auth checks are off. Then a Stream user id proves nothing. The router reads this per app from `GetApp`'s `disable_auth_checks` (`streamapp.Readiness`, readiness.go:79, cached for 60 s). With auth checks off, nothing is read, and the same holds when the app could not be asked. This PR applies the same rule to the app chat's own read (`Spec.Dispatched`, from #1702). There, `message.user.id` is only as good as Stream's token check. ## Also - **Voice:** a call from the app with no phone number on it is the device's call. A call with a phone number on it still reads the number's cards, whoever opened it. - **Resuming a conversation:** a device session that resumes a conversation leaves that conversation's own card out, because it reads that conversation word for word. - **Other users:** the session names Anya (`CardsFor`). The existing guard (`api/messagehooks.go:316`) then retires it if anybody else writes in its channel. - **Cards off:** with `episode_cards` off nothing changes. The control test's expectations were checked on base 3b7a53f. ## Tests - `session` (`EpisodeReadingSuite`): text and voice device sessions read her card. These tests fail on base. Each credential in the table above reads nothing. Another agent config of hers reads nothing. With auth checks off or the app unknown, neither the device read nor the chat read happens, and a control case shows both reads happen again once the app checks tokens. A resumed conversation leaves its own card out. A phone call reads the number's cards. With cards off, the session is unchanged from base. - `api` (`ChatEpisodesSuite`): the same table through `POST /v1/agents/sessions` with real signed tokens. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
The first `router replicate --once` of an app failed with "the source no
longer keeps the changes since that cursor". A rerun worked.
`Store.Changes` refused a cursor when the app's own oldest change came
after `cursor+1` (`internal/store/datamove.go:1205-1212` on base). But
`data_changes.seq` is shared by every app, so the numbers between an
export's cursor and the app's first change can belong to other apps that
are moving. The code read that gap as "pruned".
Pruning (`PruneDataChanges`) removes every app's changes older than the
retention, so the rows that are kept are the ones from the oldest `seq`
still in the table.
## How it works
```
data_changes.seq ... 1000 | 1001 .. 1006 | 1007
export other apps this app's first change
cursor
before: MIN(seq) of this app = 1007 > cursor+1 -> 410
after: MIN(seq) of all <= cursor+1 -> 200, the change
```
```
Changes(after)
├─ after = 0 -> answer
├─ nothing of this app kept -> answer (as before:
│ a quiet app looks the same)
├─ oldest change kept of all > after+1 -> ErrChangesExpired (410)
└─ otherwise -> answer
```
| Case | Before | After | Test |
|---|---|---|---|
| Other apps changed between the export and the app's first change | 410
| 200 |
`TestTheFirstChangeAfterAnExportIsAnsweredWhenOthersChangedInBetween`
(store),
`TestTheFirstChangeAfterAnExportIsAnsweredWhenAnotherAppChangedInBetween`
(api) |
| The change after the cursor was pruned | 410 | 410 |
`TestACursorWhoseNextChangeWasPrunedSaysToExportAgain`,
`TestAnExpiredCursorSaysToExportAgain` |
| The oldest change kept is `cursor+1` | 200 | 200 |
`TestACursorRightBeforeTheOldestChangeKeptIsAnswered` |
| A quiet app whose cursor aged out | 200, empty | 200, empty |
`TestAQuietCustomerWhoseCursorAgedOutIsNotRefused` (expected value taken
from a base run) |
### The flaky
`TestFollowingTheChangesFromWhereTheLastPageEndedRepeatsNothing`
The feed returns a change only after every older transaction has ended
(`changeWatermark`). Postgres gives out transaction ids for the whole
server, and `pg_snapshot_xmin` includes transactions in other databases
(probe: a transaction in another database showed as the snapshot's
xmin). In `internal/api`,
`ScheduledTasksSuite.TestThePauseAfterADeleteGivesUpWhenATaskRowStaysLocked`
holds a row lock for `auditWriteTimeout + 1s` = 6 s, and other suites
hold locks for seconds too. That is longer than the 5 s that
`changesSince` waits. On base, a transaction held open in another
database during the test gives the same failure as CI run 41857408342.
- `TestDataMoveSuite` (api) now starts with `suite.Run`, not `runSuite`.
It runs before the parallel suites start, as the store and `cmd/router`
suites that read the feed already do.
- The wait now uses `EventuallyWithT`, so it reports the feed's last
answer. Before, the message always said "the last answer was 0", because
the format argument was read once, before the wait.
- `go-testing/controllers.md` records this exception to "start every
suite with `runSuite`".
## SQL
<table>
<tr><th>Before</th><th>After</th></tr>
<tr><td>
```sql
SELECT MIN(seq) FROM data_changes
WHERE customer_id = ?
```
</td><td>
```sql
SELECT (SELECT MIN(seq) FROM data_changes),
EXISTS (SELECT 1 FROM data_changes
WHERE customer_id = ?)
```
</td></tr>
</table>
Both are index-only `Limit 1` scans: `data_changes_pkey` for the oldest
change of all, and `data_changes_customer_idx` for the app. Measured on
a local test database (42 rows): 2 buffers before and 4 after.
## Validation
- `go test -tags integration ./internal/store -run TestDataMoveSuite`,
`./internal/api -run TestDataMoveSuite` (3 runs), `./cmd/router -run
Replicate`: all pass.
- On base, both first-change tests fail: the store test with
`ErrChangesExpired`, the api test with 410. The other new tests pass on
base.
- Mutations of the rule, each caught: no "this app has a change kept"
clause, `>=` at the boundary, `> after+2`, no `after > 0` guard, no
expiry check, `MAX` for the oldest kept, `customer_id <> ?`.
- The flake fix has no deterministic test of its own. Evidence: on base,
holding a transaction open in another database makes the test fail. With
`-v`, `TestDataMoveSuite` finishes before `=== CONT` of the parallel
suites.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up to #1733 (review nit N2.1): the `parallel-agents` skill named the `ROUTER_POSTGRES_DSN` database `model_router_test_<slug>`. ## What the base does (runs, slug `envdsn`, base d1753ae) ``` go test (testing.yaml -> model_router_test_envdsn_test) └─ internal/testenv init: config.Load(testing) + export └─ os.Setenv(ROUTER_POSTGRES_DSN / ROUTER_REDIS_ADDR) = testing.yaml values (config.go:1034,1037,1112) └─ the shell's value is gone before any suite reads it ``` | Run (base) | env DSN db | Result | Databases created | |---|---|---|---| | cmd/router Sandbox/StreamApps/OpenStore | `model_router_test_envdsn` (doc) | pass | `..._test_envdsn_test`, `..._openstore_test_envdsn_test`, `..._router_cli_test_envdsn_test` | | same | `model_router_test_envdsn_test` | pass | same three | | same | unset | pass | same three | | internal/api PoliciesSuite | doc / unset | pass (37 subtests, no skip) | none new | | internal/store StoreSuite (1 test) | doc | pass | `model_router_store_test_envdsn_test` | | internal/imagerouter (no testenv import) | doc | **fail**: `database "model_router_test_envdsn" does not exist` | none | | internal/imagerouter | `_test` | connects; 1 pass, 1 fail unrelated (`nothing quick/fast resolves to can honour size`, same on base; skipped on CI, AI-2040) | none | So: - The env name matters only in packages that do not import `internal/testenv`: `internal/imagerouter`, `internal/testenv/redisready` (and `internal/config`, which sets its own). - The doc's name made `imagerouter` fail and is a database the cleanup lookup `'%\_<slug>\_test'` misses. - "the `internal/api` suites skip silently without them" no longer holds (api passes with the env unset). - The `_test` name shares nothing new: `internal/api` already used `model_router_test_<slug>_test` on the base. ## Change `.claude/skills/parallel-agents/SKILL.md`: set `ROUTER_POSTGRES_DSN` to the `testing.yaml` DSN (`model_router_test_<slug>_test`), and say why. ## Proof on the branch (slug `envdsnb`, env = testing.yaml DSN) cmd/router 3 suites, api PoliciesSuite, store StoreSuite, redisready: pass. imagerouter: connects (same unrelated failure). Every created database is found by the lookup: ``` all : model_router_openstore_test_envdsnb_test model_router_router_cli_test_envdsnb_test model_router_store_test_envdsnb_test model_router_test_envdsnb_test lookup : (same four) ``` Docs only: `Integration (router)` does not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
Linking a user to a number (`PUT /v1/agents/users/{user_id}`) joined the
number's contact row to the user's omni-channel, and **the row's
episodes came with it** (`episodes.contact_id`). The user's app chat
then read SMS/call cards from before the link: the last holder's, or
texts from someone the customer had not vouched for yet.
`detachLinked` (on unlink) does not stop this. It gives the number's row
a new omni-channel, but the row keeps its episodes, and the next user's
link joins that row again.
## Actors
| Actor | Example |
|---|---|
| Number | `+1•••0100`, texted the agent on Monday |
| Linked user | Bob, linked to the number on Tuesday by the customer's
backend |
| Previous holder | Anya, linked to the number before, then unlinked |
## What changes
```
PUT /v1/agents/users/bob {"phone": "+1•••0100"} (number new to bob)
store.LinkUserPhone, under the link's lock, in one tx
upsert user_phones
retireHistory NEW the number's rows that hold episodes
(each agent config with episode_cards on, link's app)
keep omni-channel + episodes, address -> retired:<row id>
detachLinked bob's old number, as before
joinLinked bob's row + the number's rows (none with history now)
next SMS from +1•••0100 -> MapContact makes a new row -> joinPartner -> bob's omni-channel
```
| Case | Before | After |
|---|---|---|
| Number texted before the link, then linked to Bob | Bob's chat reads
the Monday SMS | Bob reads only his own cards |
| Anya linked, texted, unlinked; Bob linked | Bob reads Anya's SMS | Bob
reads none |
| SMS after the link | reaches Bob | reaches Bob |
| Same link sent again | no change | no change |
| Config with `episode_cards` off | rows join as they are | unchanged
(no row is set aside) |
| Number row with no episode | joins | joins |
The set-aside row keeps its omni-channel, so its cards stay where they
were written and the Closer still updates them there. No migration:
`retired:` is never a prefix of an E.164 address, so no lookup by the
number finds the row.
Decision (final): the user's own texts from before the link do not join
either. Nothing proves they were the user's.
## Tests
- `internal/api` `TestUserPhonesSuite`, through the PUT:
- `TestALinkedUserReadsNoneOfTheNumbersSMSFromBeforeTheLink`: fails on
base (`[chat sms]`).
- `TestAUserLinkedToANumberSomebodyHadBeforeReadsNoneOfTheirSMS`: fails
on base (`[chat sms]`).
- `TestAnSMSAfterTheLinkReachesTheUsersChat`: fails on base (`[sms chat
sms]`).
- Controls that pass on base and on head:
`TestTheSameLinkAgainKeepsTheCardsWrittenSinceTheFirst` and
`TestAConfigWithoutCardsLinksAsBefore`.
- Updated to the new rule:
`TestAChatRowMadeAfterTheLinkJoinsTheOlderSMSOmniChannel` (it replaces
"joins the chat onto the older SMS omni-channel", which pinned the old
behaviour), plus the idle closes in the two unlink tests.
- `internal/store`:
- `TestALinkSetsAsideTheNumbersRowsThatHoldEpisodes` checks scope:
another app, another number, a row with no episode, a config with cards
off, every agent config, and that the next sighting joins.
- `TestALinkAndTheNumbersNextSightingAtOnceJoinNoneOfItsHistory` runs
the link and the next sighting at once (2 pools × 20).
- Mutations: dropping any one of these conditions fails a test: the
episode EXISTS, the app pin, the address, the `episode_cards` gate, the
`retired:` prefix, the repeat guard, or retire-only-on-relink. Dropping
`kind` or `cm.customer_id` changes nothing; they are kept for the
`contact_map_address` index.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…detection billed by vendor usage (#1735) Linear: AI-1824 Perplexity ended Sonar Chat Completions on 2026-09-27, and Sonar is now billed as an Agent API request: tokens plus each web search. This moves the adapter to the Agent API and retires Sonar Pro, which has no Agent API model. It also settles two detection prices the same price check couldn't confirm, by billing what the vendor reports instead of a flat rate per image. **Sonar** - `POST /v1/agent` with `model: perplexity/sonar`, a `web_search` tool capped at the query's limit (`max_results`), and `tool_choice: web_search`, so it always searches instead of answering from memory. Short instructions keep the answer to a few plain sentences for speech. - The answer is the `output_text` of the `message` item. Sources are the `search_results` items, trimmed to the limit (the cap is per search, and a model may search twice). - `search.Result` gains `Usage`. Sonar reports fresh input tokens (`input_tokens` minus `cached_tokens`), cached input tokens, output tokens, and one request per web search (`tool_calls_details.search_web.invocation`). Every other search provider is still one request. Perplexity's own `total_cost` is still kept beside the row. - `vendor.json`: `perplexity/sonar` goes from a $6 per 1k request estimate to $0.25/1M input, $0.0625/1M cached input, $2.50/1M output and $2.50 per 1k searches ([pricing](https://docs.perplexity.ai/docs/getting-started/pricing), [models](https://docs.perplexity.ai/docs/agent-api/models), read 2026-11-04). A deployment that keeps its price list in Postgres needs a price-list change for this item. **Sonar Pro retired** - Removed from `router.yaml` and `vendor.json`. `New` refuses it. - A modality's new `retired` map names a model that's no longer offered and what to ask for instead. A request pinned to `perplexity/sonar-pro` now gets a 400 `routing: perplexity/sonar-pro is retired; ask for perplexity/sonar instead` instead of `unknown target`. Config validation refuses a retired name that's still declared, or a replacement that isn't. **Moondream detection by the token** - Moondream bills `/detect` per token: about 736 input tokens for the image and 3 output tokens per box, at $0.30/1M in and $2.50/1M out for Moondream 3 Preview ([pricing](https://moondream.ai/pricing), read 2026-11-04). Each call's response reports them in `metrics`. - `detection.Result` gains `InputTokens` and `OutputTokens`. Moondream sums them over its per-class calls, and `Used()` reports tokens when a provider counted any, or images otherwise. - `vendor.json`: `detection/moondream/moondream3-preview` goes from $0.00025 per image to the token rates. - The detection router's hold estimate is one image plus one call's tokens (750 in, 30 out), so it covers either kind of entry. An entry prices only the meters it rates. **Roboflow Workflows by their model calls** - A Workflow run bills each model step at that model's rate for every image it processes, so the face Workflow costs the detector once plus CLIP once per face crop ([pricing](https://docs.roboflow.com/deployment/roboflow-cloud/serverless-api/pricing), [model rates](https://docs.roboflow.com/deployment/roboflow-cloud/serverless-api/model-pricing), read 2026-11-04). - Roboflow lists those calls in the `X-Remote-Processing-Times` header (one entry per model per image, checked live with one face and with three). `Billed` is now the number of entries, or the image plus one per embedding when the header is missing. - `vendor.json`: `detection/roboflow/faces` goes from $0.0015 to $0.00075 per image, now charged per model call. That's 0.125 credits per 1,000 images at $6 per credit, the rate for Nano detectors and CLIP ViT-B/32. `workflow` keeps $0.00075, now per model call instead of per run. A caller's Workflow that runs larger models or a vision language model still costs Roboflow more than that. **Tests** - Unit tests: the request shape, token and search counting, an answer that searched nothing, the source cap, Sonar Pro refused, retired targets, and both validation failures. - Integration, run live against Perplexity: the shared search suite for Sonar, plus a check that a real answer reports tokens, at least one search and a cost. The index suite's `Answers: true` was wrong (the index writes no answer) and is dropped. - Detection: Moondream's per-call tokens are summed and reported as tokens. Roboflow Workflows are billed by the listed model calls, with a fallback when the header is missing. Live: the Moondream suite checks a real look reports tokens, and a live face Workflow run lists two model calls.
Linear: AI-1824 `TestImageRouterIntegrationSuite/TestAnImageRowSaysTheSizeItWasDrawnAtWhichCanChooseThePrice` fails with `imagerouter: nothing quick/fast resolves to can honour size`. The image router refuses a request that names a term (here a size) its model doesn't declare, and the test's stub model declares no terms. The stub model now declares `options.Size`. Nothing outside the test changes. **Tests** - `TestImageRouterIntegrationSuite` passes against a local Postgres; it failed before this change.
## Why
`TestLiveGrantsLeaveOutRevokedAndExpired` gave a grant 500 ms to live,
then made three grants and a revoke before asking
`LiveGrants(time.Now())` for it. On a slow Postgres the setup outlasted
the 500 ms and the grant was already expired:
```
expected: []int64{1, 2}
actual : []int64{1}
```
```
before after
soon = now + 500ms expires = now + 1h (µs, as Postgres keeps it)
3 × AddGrant, RevokeGrant ── slow? ── 3 × AddGrant, RevokeGrant (any speed)
LiveGrants(time.Now()) → live? LiveGrants(expires - 1µs) → live
LiveGrants(soon) → expired LiveGrants(expires) → expired
```
The hour only keeps the insert ahead of `limit_grants_expiry_check`
(`expires_at > created_at`); the assertions no longer read the clock.
Both sides of the boundary are now pinned.
Also: `integration.yml` said imagerouter and dlc skip themselves on CI.
They do not (no `CI` check in either package); they are left out of the
matrix (AI-2040).
## Evidence
| run | base 90167d7 | branch |
|---|---|---|
| `pr/repro.sh` -count=6: another session holds org-1's grant lock
(grants.go:114) 600 ms at a time, so each AddGrant is slow | 6/6 FAIL |
6/6 PASS |
| whole `TestStoreSuite`, 3 separate runs | — | 3/3 ok (206 s, 221 s,
225 s; load 5-9) |
Mutations of `whereLive` (grants.go:69), each fails the test:
| mutation | fails at |
|---|---|
| `expires_at > ?` → `>=` | "at expires_at it is expired" |
| expiry clause dropped | "at expires_at it is expired" |
| `revoked_at IS NULL` dropped | both |
| boundary 1 ms early | "just before expires_at it is live" (the old
test let this pass) |
## Siblings checked
| test | verdict |
|---|---|
| `TestAWaiterPastItsDeadline…` (credentials_test.go:357) | not this
cause: no setup inside its window, only the waiter's own ctx-bounded
wait; left as is |
| sleeps / `time.After` before a commit (streamtrunks:105, episodes:282,
store_test:1507, datamove:1458) | can only pass falsely under load,
never fail |
| `shipping_test.go:26`, `usage_id_migration_test.go:170` | upper bounds
with seconds of slack on a server-side timeout |
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
A number attached on a trunk of its own (from before trunks were shared)
is adopted into a shared group by `Service.adopt`. Adoption sends
`UpdateRoute` for the stored rule id
(`acceleration/internal/phone/lines.go:221` on base). When the rule is
gone at Stream, Stream answers 404 `DoesNotExist`
("SIPInboundRoutingRules with id … can't be found"; GetStream/chat
`lib/video/state/sip_inbound_routing_rules.go:227`,
`lib/core/errors/errors.go:231`). The transaction rolls back and stores
nothing. So every outbound call from the number and every `POST
/v1/phone/numbers/{e164}/attach` failed the same way, with no way to
recover. `join` had the same problem with `UpdateTrunk` on a shared
trunk that Stream lost.
Do not blindly create a replacement. Stream can still route the number
through a rule or trunk this router did not store, for example one made
by another deployment on the same app. A second rule would compete with
it. Stream already refuses a second trunk listing the number
(`lib/video/controller/create_sip_trunk.go:71`), but it does not refuse
a second rule.
## How it works
```
line(number) caller: attach, outbound call (sharedLine)
├─ stored trunk is a group row ──> lineOn (no Stream call, unchanged)
├─ stored trunk not a row ───────> adopt
│ └─ UpdateRoute(stored rule)
│ ├─ ok ───────────────────> as before
│ └─ 404 ─> answering(number): list rules + trunks at Stream
│ ├─ a rule, or a trunk other than ours, has the number
│ │ ─> errRoutedElsewhere (Warn log), no write
│ ├─ our trunk is gone ─> join, like a new number
│ └─ our trunk is there ─> CreateRoute, SetLine(new rule id)
└─ no stored trunk ──────────────> join
└─ UpdateTrunk(roomiest shared trunk)
├─ ok ───────────────────> as before
└─ 404 ─> answering(number)
├─ anything has the number ─> errRoutedElsewhere
└─ nothing ─> drop the lost trunk's row, CreateTrunk for the number
(each number left on it goes to adopt on its next line, then joins)
```
| Actor | Role |
|---|---|
| Router (`internal/phone`) | holds the stored trunk/rule ids per number
in Postgres |
| Stream Video SIP | holds the trunks and inbound routing rules |
| Vendor (Twilio, Telnyx, …) | sends the number's calls to the Stream
trunk |
## Changes
- `lines.go`: `adopt` makes a lost rule again (`routeAgain`); a lost own
trunk goes to `join`; `join` replaces a lost shared trunk
(`forgetLostTrunk`). Every replacement first passes the guard
(`routedElsewhere`, a new `errRoutedElsewhere`).
- `stream.go`: `answering` lists the app's rules and trunks for one
number. Both list endpoints are unpaged (`list_sip_trunks.go:47`,
`list_sip_inbound_routing_rule.go:48` in GetStream/chat).
- `chattest`: the fake Stream answers `GET /sip/inbound_trunks` and `GET
/sip/inbound_routing_rules`.
| Case | Before | After | Test |
|---|---|---|---|
| adopted number, rule lost | 404 forever | new rule, id stored |
`TestAnAdoptedNumberWhoseRuleStreamLostGetsANewOne`,
`TestACallFromANumberWhoseRuleStreamLostPlaces`,
`TestAttachingANumberWhoseRuleStreamLostGivesItANewOne` |
| adopted number, trunk + rule lost | 404 forever | joins a shared
trunk; attach points the vendor at it |
`TestAttachingANumberWhoseOwnTrunkStreamLostPutsItOnASharedOne` |
| shared trunk lost | 404 forever | new trunk; its other numbers follow
|
`TestANumberJoiningASharedTrunkStreamLostGetsANewOneAndTheTrunksNumbersFollow`
|
| Stream routes the number elsewhere | 404 forever |
`errRoutedElsewhere`, nothing made |
`TestANumberStreamRoutesThroughAnotherRuleIsNotGivenASecond`,
`TestANumberAnotherTrunkAtStreamListsIsNotGivenATrunkOrARule`,
`TestANumberJoiningALostTrunkWhileStreamRoutesItElsewhereIsRefused`,
`TestANumberJoiningALostTrunkWhileAnotherRuleAnswersItIsRefused` |
| the line fails after the rule is made again | n/a | the new rule is
deleted | `TestARuleMadeAgainForALineThatThenFailsIsDeleted` |
| working line | PUT rule, PUT trunk, POST rule | the same requests
(taken from a base probe) |
`TestAWorkingLineAsksStreamWhatItAskedBefore` |
## Validation
- `go test -tags integration -p 1 ./internal/phone/...` and
`./internal/session -run TestTransferSuite`, which also uses the fake's
SIP routes: pass.
- `go vet -tags integration ./...` and `gofmt`: clean.
- 18 mutations, one per changed condition (each guard half, the 404
branches, `SetLine`, the rollback id, the row drop, the `answering`
matches, the route id returned). Each one fails at least one test above.
- Not covered: `lineOn` makes no Stream call, so a number whose trunk
row is still stored but whose rule Stream lost is not detected. An
attached number takes the early return in attach (`service.go`,
`attachedHere`) and never reaches `line`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…1741) Fix-forward of #1728 (AI-2716). After a user is linked to a number, the user's app chat could still read texts the number sent **before** the link. They arrived through the card of the number's next SMS episode while that episode was in progress. ## Actors | Actor | Example | |---|---| | Number | an SMS line holder texting the agent | | User | `anya`, linked to the number by the customer's backend (`PUT /v1/agents/users/anya`) | | Thread channel | `agent:thread-…`: every text of the number, one episode after another | ## What happened ``` Mon number: "my cat is Saffron" episode 1 (closed) row set aside by the link (#1728) Tue link anya -> number Wed number: "my dog is Pepper" episode 2 (in progress) new row, joins anya's omni-channel Wed anya's app chat reads episode 2's card: base: lines = last 20 of the thread channel -> ["my cat is Saffron", "my dog is Pepper"] (leak) now: lines = from episode 2's start -> ["my dog is Pepper"] ``` Cause: `omnichannel/read.go` `tell` called `linesOf(…, maxCardLines, fromStart=false)`. The start bound applied only to calls and to summaries (`close.go`, `fromStart=true`). An SMS thread channel (and an app chat's agent channel) holds every episode of its thread. ## Change - `linesOf` bounds every card's lines by its episode's start; the `fromStart` switch is gone. Summaries are unchanged: they already read from the start. - Sibling: a chat card in progress no longer repeats the earlier runs of its channel. Each run has its own card. - Safe for the first message. The bridge opens an SMS or Slack episode at the queue time (`channel_thread_inbound.created_at`, Postgres `now()`), before it writes the message to Stream (`channelbridge.writeQueued`). A chat episode starts at its message's `created_at` (#1715). - Test helpers that opened an episode *after* writing its first message now open it first, as the bridge does (`EpisodeReadingSuite.chatNow`, `EpisodeCardsSuite.smsWithALine`). ## Tests - `TestALinkedUsersChatReadsNoneOfTheNumbersTextsFromBeforeTheLink`: episode 1 closed, and episode 1 still open at the link. Fails on base in the closed case. - `TestAnSMSCardInProgressHasOnlyItsOwnEpisodesLines`: an unlinked number's call. Each card has its own lines. Base gave the in-progress card both texts. - `TestAChatCardInProgressHasOnlyItsOwnEpisodesLines`: the chat sibling. - Controls: existing call-window tests and the `episode_cards` off tests (`TestWithTheCardsOff*`), unchanged and passing. Mutations, each caught: start bound for calls only (base), chat exempted, bound loosened by 2 h, `!After` in place of `Before`. Calls only also fails `CloserSuite/TestASummaryReadsOnlyItsOwnEpisodesLines`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
A WhatsApp photo reached the agent as its caption alone (`whatsapp.yaml`
revision 2, AI-2133). On staging, a photo sent with «What is in this
photo?» got the answer «It looks like you didn't attach or upload an
image!», and a photo sent alone got no answer at all. The webhook names
the photo only by an id. Graph's `GET /{media-id}` answers a URL on
`lookaside.fbsbx.com`, and that URL answers 401 without the business
number's token (Meta's media reference page, opened 2026-11-04, and a
probe of the staging line on v25.0). So a link to Meta cannot go into
Stream Chat or reach the model: the router has to download the photo
with the connection's own credential and hand over a copy that anyone
can read.
## How it works
```
Meta webhook ─> POST /v1/connectors/events/whatsapp/{app}
take: read with the connection's pinned revision (3)
also[image].media: image.id + image.mime_type -> Media{ID, MIMEType}
a photo without a caption is read too (empty text, one file)
queue row: media [{"url":"","mime_type":"image/jpeg","id":"…"}]
worker writeQueued
├─ admit (keywords, gate) unchanged
├─ download (before the episode opens) connection's client = its bearer
│ GET https://graph.facebook.com/v25.0/{id} answer <= 64 KiB, JSON $.url
│ MediaFile: https + host lookaside.fbsbx.com alone, no userinfo, no port
│ GET <url> 200 only, <= 5 MiB, sniffed image/*
│ any failure -> no file, Warn with the connection id and no URL
├─ only files, none downloaded, no text -> not written, row done (Warn)
├─ episode
└─ writeInto: upload to the thread channel as the person (conversation.Upload)
image attachment = Stream Chat CDN URL -> api.threadPhotos -> model
already written (retry) -> rebuilt with this attempt's uploads
```
| Case | Before (rev 2) | After (rev 3) | Test |
|---|---|---|---|
| photo + caption | caption, no image | caption + image |
`TestAPhotoWithACaptionReachesTheModelWithItsCaption` |
| photo alone | not read | image |
`TestAPhotoWithoutACaptionReachesTheModel` |
| download fails (10 shapes, host pin included) | – | caption alone, no
upload, token sent only to Graph and lookaside |
`TestAPhotoThatCannotBeDownloadedIsAnsweredByItsCaptionAlone` |
| photo alone, download fails | – | not written, no card, row done |
`TestAPhotoAloneThatCannotBeDownloadedIsNotWritten` |
| Stream Chat refuses the upload | – | attempt retried, photo written |
`TestAPhotoWhoseUploadFailedIsWrittenWithItOnTheNextAttempt` |
| retry finds the message written | – | model gets this attempt's upload
| `TestAPhotoStreamChatAlreadyHoldsReachesTheModelFromItsUpload` |
| connection on revision 2 | caption alone | same; no lookup |
`TestAConnectionStillOnRevision2ReadsAPhotoByItsCaption` |
## Changes
- `core`: `MediaRule.ID` (a file named by an id), `MessageKind.Media`
(one file for an `also` kind, which is read when its caption is empty or
its file is found), `MessageRule.MediaLookup` (`url` with `{id}`,
`file`, `host`), and `ResolvedManifest.MediaLookupURL` / `MediaFile`
(the host pin). `Validate` checks each new field. The manifest JSON of
revisions that do not use them is the same bytes as before.
- `store`: the queue row keeps `Media.ID` (`id`, omitempty).
- `channelbridge`: `download` (new `media.go`); `writeInto` uploads the
files and keeps them on the already-written path (`rewritten` is gone);
`photos` skips a file named by id.
- `conversation`: `upload`'s body becomes `Upload`, for the bridge.
- `whatsapp.yaml` revision 3, with each vendor fact cited. Revisions 1
and 2 are unchanged.
- Docs: `core/AGENTS.md`, `channelbridge/AGENTS.md`, `CHANGELOG.md`.
The design adds no provider Go: the lookup and the host are manifest
data, and the download goes through the existing credential path
(`core.Transports.Client`). The host pin is new because `credentialed`
puts the bearer on any URL (`core/transport.go`). Production's egress
client already refuses a redirect to another origin (`egress/public.go`
`checkRedirect`).
## Validation
- On the branch merged with accelerate 90167d7: `go test
./internal/store ./internal/connectors/... ./internal/conversation/...
./internal/channelbridge` passes. `go test -tags integration -run
'TestWhatsAppChannelSuite|TestLinqChannelSuite|TestMessageHooksSuite|TestResponsesAskedSuite|TestChatInboundQueueSuite|TestSlackChannelSuite|TestTelnyxChannelSuite'
./internal/api` passes. So do `-run TestStoreSuite ./internal/store` and
`-run 'TestInboundSuite|TestBridgeSuite' ./internal/channelbridge`.
- Mutation checks: 50 mutants, every one killed by a named test. Core
has 26 (the host pin, https, userinfo, port, `{id}` through `render`,
the photo-alone read, kind media replacing block media, and each new
`Validate` rule). The bridge has 24 (the 5 MiB and 64 KiB caps and their
constants, 200 only, the image sniff, image/* only, `photos` skipping id
files, each clause of `nothingToWrite`, a failed upload retried, the
uploads kept on the already-written path). The store has 2 (the `id`
key). One mutant survived: it removed an empty-id check, and that check
was dead code, because `readPath` finds no empty string
(`core/channel.go` `scalarValue`). The check is gone.
- Controls: the revision-2 test pins a manifest whose parsed JSON equals
base c47835b's `whatsapp.yaml`. Its expected values are base's own
revision-2 tests (`TestAPhotoWithACaptionIsAnsweredAsItsCaption`,
`TestAPhotoWithoutACaptionAndOtherKindsAreNotWritten` at c47835b). The
Linq photo and video tests run unchanged.
Unverified: whether a lookaside 401 can happen on a fresh URL. The
bearer scheme reads any 401 as a refused token and marks the connection
(`bearer/scheme.go` Classify). Each attempt looks the URL up right
before the GET, and the URL lasts 5 minutes. Also unverified: the real
Stream Chat accepts a server-side `UploadChannelImage` on the thread
channel as the person, as `PublishPhotos` does for app chats.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
The router decides which connector tools only read from each source's
`read_only_tools` (or `outbound: false`), and refuses a config that
grants any other tool beside a sensitive connector such as Nessy without
`require_approval`. No API response said which tools those are, so
clients guessed from tool-name verbs. Athena's admin preselected
Linear's `search_documentation` as a read, and the router refused the
save: linear.yaml leaves it out of `read_only_tools` because it sends
the model's text to Linear's public docs search.
## How it works
```
GET /v1/agents/connections/{id}/tools
└─ for each cached tool
read_only = !latest.Manifest.SendsOutTool(name)
│
POST/PUT /v1/agents/configs │ one function
└─ SensitiveBindingsComplaint │ core.Manifest.SendsOutTool:
└─ bindingSendsOut │ any source may send it
└─ manifest.SendsOutTool ──┘ (not read_only_tools, not outbound:false)
```
Both read the connector's **latest** revision
(`LatestConnectorDefinition`), not the revision the connection pins:
that is what the config save checks (`internal/api/configs.go`,
`SensitiveBindingsComplaint`), and what `Manifest.ReadsAsConnection`
already says about `read_only_tools`.
| Tool (built-in linear) | `read_only` | Beside nessy, granted by name |
|---|---|---|
| `list_issues` | true | accepted |
| `search_documentation` | false | refused unless `require_approval`
holds it |
| `save_issue` | false | refused unless `require_approval` holds it |
## Changes
- `core.Manifest.SendsOutTool(name)`: the any-source rule moved out of
`bindingSendsOut`, which now calls it.
- `ConnectionTool.read_only` (always present) on `listConnectionTools`,
with a `doc:` tag; operation description says so.
- `GET /v1/agents/connectors` is unchanged: the per-tool flag is what a
client needs. A raw `read_only_tools` list would leave clients to
combine it with `outbound` themselves, which is a second copy of the
rule.
- Regenerated: `openapi.yaml`, Go, JavaScript, Python
(`plugins/stream`), .NET, Ruby, Rust, PHP. Swift, Kotlin and Dart
generate nothing for this server-side operation (`sdks/swift/generate.py
--check`: 22 client operations, none server-side only). A note in the
`sdk` skill. CHANGELOG entry.
- Volt reads only `name` and `schema_digest` from this response
(`connector-bindings.ts`, `connector-binding-dialog.tsx`), so the added
field breaks nothing there.
## Validation
| Test | Defect it catches |
|---|---|
|
`ConfigsSuite/TestABindingBesideNessyMayGrantExactlyTheToolsFlaggedReadOnly`
| flag disagrees with the save: built-in linear, tools flagged true are
accepted beside nessy, and each tool flagged false is refused and named
|
|
`ConfigsSuite/TestReadOnlyIsTheConnectorsLatestRevisionsAsAConfigSaveChecks`
| flag read from the pinned revision (connection on rev 1, rev 2 adds
`search_documentation`) |
| `ManifestSuite/TestAManifestSendsOutAToolAnyOfItsSourcesMaySend` |
first-source-only or every-source rule instead of any-source |
Mutations, each killed: negation dropped, always true, always false,
pinned revision instead of latest, first source only, every source,
`bindingSendsOut` skips the manifest rule.
Ran: `go test ./internal/connectors/...`; `go test -tags integration
./internal/api` (whole package, own test DB); `go vet` (with and without
the integration tag); the CI generated-code checks for Go and JS.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
A person sent Athena a link to a Slack thread and asked it to read the
thread. `slack_read_channel` (twice) and `slack_read_thread` came back
refused in 1 ms, before reaching Slack. Writing «channel <id>» worked
(AI-2791).
The refusal is the router's ID guard, `unfoundID`
(`acceleration/internal/agent/ids.go`), called for every tool call in
every session at `internal/agent/telephony.go:646`. It lets an ID
through when a tool returned it, the operator wrote it, or the person
said it together with what it is (`entityOf("channel_id")` = «channel»).
Two things failed here:
1. **The link.** The channel ID was a path segment of the link
(`…/archives/C…/p…?…&cid=C…`). The person never wrote the word
«channel», so the ID did not count.
2. **The earlier search.** The IDs that `slack_search_channels` /
`slack_list_user_channels` returned did not count either. Slack's MCP
server answers with a JSON object whose text sits under a key of its
own: `{"results": "…\n1. #help (C…) - public_channel - …",
"pagination_info": …}`. `slack_read_channel` and `slack_read_thread`
answer with `{"messages": "…", …}`. Seen in the results of the same
tools through the claude.ai Slack connector. The tool names match the
server's live `tools/list` saved for AI-2756. The guard puts every JSON
object through `walkIDs`, which reads only `id` and `*_id` keys
(`ids.go` `walkIDs`). It read text with `holdsValue` only when the whole
result was not JSON. So the `C…` inside the markdown string was never
seen.
## How it works
```
unfoundID(record, call) for each *_id argument a tool hands out
├─ said with its entity word ("channel C0…") unchanged
├─ NEW: a whole path segment or query value of an
│ http(s) link in a user message -> given
│ not: part of a segment, host, fragment,
│ query key, a link the agent or a tool wrote
├─ said in answer to the agent asking for it unchanged
├─ written in the operator's instructions unchanged
├─ returned by a tool
│ ├─ under its key or "id" in a JSON result unchanged
│ ├─ a word of a text result unchanged
│ └─ NEW: a word of a line of a multi-word string
│ inside a JSON result, when the line names
│ the ID's kind ("channel" for channel_id)
│ and the call it answers was not sent the
│ ID anywhere in its arguments -> returned
└─ otherwise -> refused
```
An ID counts when:
- it is a whole path segment or query value of a link the person wrote;
or
- a tool's JSON text writes it on a line that names its kind, and the
call was not sent that value.
The second rule leaves out an echo: a result that writes the query back
(`Channels for: C0…`) returns nothing. The echo check compares the ID
with the call's arguments with everything but letters and digits
dropped, so a tool that splits or joins the query's words
(`C0FAKE01-general` written back as `C0FAKE01 general`, or `C0 FAKE 01`
as `C0FAKE01`) is still an echo.
## How this differs from #1347, #1381 and #1384
- #1347 (00725c9) undid «an ID of letters and digits the caller said
whole is theirs, whatever they called it». That rule took any word of
anything the caller said. This one takes only a whole part of a link, a
place that names what the part is (the path or a query key). A bare
`C0…` in a sentence with no entity word is still refused: the control
case, whose expected value comes from base.
- #1347 also stopped taking a one-word value under a collection key as
an ID of another kind («a reservation is not an order», «a card listed
under card_list passed as an order_id»). The new JSON reading skips
one-word strings for that reason. A mutation that reads one-word strings
fails those older tests (see Validation).
- #1381 (6ac716e) and #1384 (9b83641) removed and narrowed guards
tuned to the benchmark. This PR adds no refusal. It names no vendor,
host or link format in code: `http(s)://` plus the RFC 3986 §2 set of
characters no URI holds unescaped.
## Changes
- `ids.go`: `linkParts` (path segments and query values of the links in
a user message, compared whole and alphanumeric like every other value
in the guard). `prose` (the multi-word strings of a JSON result).
`unfoundID` records each call's arguments by call ID and splits each
prose string into lines; a line returns an ID only when it names the
kind and the call it answers was not sent the ID.
- Tests, in `internal/agent`:
- `TestAnIDPastedInALinkIsPassedOn`: path segment, query value, label,
quotes, scheme case, escapes; refused: substring, host, fragment, query
key, no scheme, link the agent wrote, no link (control).
- `TestAnIDAJSONResultWritesOutIsPassedOn`: a channel list with IDs is
returned; a link a tool wrote is not.
- `TestAnIDAJSONResultEchoesOrWritesBesideAnotherWordIsNotPassedOn`: a
query echoed (also with its words split or joined), a time, an error
code, a card on a line that names no such kind.
- `TestAgentSuite/TestAnIDInALinkThePersonWroteIsPassedOn`: an agent in
a text session runs `read_channel` for a channel ID that is only in the
person's link.
## Validation
| Case | Base | Head |
|---|---|---|
| ID as a path segment / query value / `<link\|label>` / in JSON quotes
/ `HTTPS://` / `%34`-escaped | refused | given |
| ID alone in a sentence, no link, no entity word (control) | refused |
refused |
| ID inside a longer segment (`p1793…`) or a longer query value |
refused | refused |
| ID as host, fragment, query key, link without a scheme, link that does
not parse | refused | refused |
| ID only in a link the agent wrote | refused | refused |
| ID on a line of the `results` text of a JSON search answer that names
the kind, the search not sent it | refused | returned |
| query echoed in the answer, also with its words split or joined
(`C0FAKE01-general`, `C0 FAKE 01`) | refused | refused |
| value of another kind on a line that names none (a time, an error
code, a card) | refused | refused |
| one-word string under a non-ID key; failure quoting the ID | refused |
refused |
Base column: the new tests run against `ids.go` from dd97944; every
«refused» row passed there. Mutations (each killed; log in the ledger):
drop the link check, drop path or query parts, substring match, links
from the agent or from tool results, allow `|` or `"` in a link,
case-sensitive scheme, host / fragment / query keys counted, decoded
path, no parse-error skip, scheme optional, no JSON prose, one-word or
two-word strings as prose, lists not walked, no echo check, no kind word
on the line, no line split, arguments not recorded. `go test
./internal/agent` and `go vet ./internal/agent` pass on the branch
merged with `accelerate`.
Known residual: a line that names the kind can carry another kind's ID a
tool really wrote (`Channel #x by U0…` for a `channel_id`). Base refused
it. Same class as a link holding two IDs: the ID is real, the kind is
wrong, and the vendor fails the call.
Unverified: the exact text Athena received from `slack_search_channels`
in the reported session (prod, not read). The shape above comes from the
same tools called through the claude.ai Slack connector.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
`router replicate` follows `GET /v1/data/changes`, which hands out
changes in `data_changes.seq` order. A number is taken when a row is
written, and other readers see it only when its transaction commits. The
old cursor rule (`MIN(seq) - 1 WHERE tx >= pg_snapshot_xmin(...)`, else
`MAX(seq)`) only looked at committed rows. A transaction still running
has no visible row, so it could not hold the cursor back:
```
Postgres sessions seq what Changes returns
older tx writes n+1
newer tx writes n+2 (still running)
older tx writes, COMMIT n+3
Changes n+1, n+3 cursor n+3 <- steps over n+2
newer tx COMMIT
Changes nothing: n+2 is lost
```
`tx < xmin` cannot fix this while the cursor is a sequence number. A
visible row with `tx < xmin` guarantees that its transaction and every
older one have ended. It says nothing about which lower number a newer
transaction that is still running holds, and no committed row can show
that number. The README claimed the opposite (`README.md`, data move
section).
Sibling: pruning went by `at`, which is when the transaction started,
not when it took its number. It could drop n+3 and keep n+2. A cursor at
n+2 then saw no gap before the oldest kept number, so it got no 410 and
carried on past n+3.
## How it works
```
record_data_change (trigger), first captured change of a transaction:
handed_out := highest number handed out so far (data_changes_seq_seq)
pg_advisory_xact_lock_shared(hi32, lo32 of handed_out) held until it ends
INSERT ... seq = nextval -> always > handed_out
Store.changeWatermark (reader), two statements, in this order:
1. handed_out from the sequence
2. MIN(lock key) from pg_locks, this database, two-integer advisory locks
mark = min(1, 2)
```
Why the mark holds. Take a number at or below (1). It was handed out
before (1) was read. Its transaction took its lock before taking the
number, so before (2) was read. At (2), one of two things is true. The
lock is still there, so the mark is at or below its key, which is below
the number. Or the transaction has ended: Postgres releases the locks
only once the commit is visible (`CommitTransaction`,
`src/backend/access/transam/xact.c`: "this must be done _before_
releasing locks we hold"). A number taken after (2) is above (1). So any
statement that starts after the mark sees every change at or below it,
and no change at or below it can still appear. The mark can go down: the
trigger reads the sequence and takes its lock in two statements, and a
mark read between them is above that lock. The feed does not need it to
only go up: each mark on its own is below every change in flight. The
expiry check below does (see its row).
| Where | Before | After |
|---|---|---|
| `Changes` | the mark is a subquery in the same statement as the rows |
the mark is read first, then the rows with `seq <= mark` |
| `Changes` expiry | `kept > after+1` → 410 | the same, and only when
`after < mark`: pruning drops only numbers at or below the mark it read,
so a gap right after a cursor at or above the mark is a change still in
flight, not a pruned one (outside the window above, where the mark goes
down). The oldest-kept check and the rows are read in one
repeatable-read, read-only transaction, so a prune between them cannot
drop rows after the cursor unseen |
| `ExportCustomer` | cursor = the old watermark, read inside the
repeatable-read transaction | mark read before the transaction, whose
snapshot comes later; cursor = the newest change kept at or below the
mark, 0 with none, read in the transaction, so every change at or below
the cursor is in the export. Not the mark itself: on a table with no
change kept, a number rolled back right after it would read as a pruned
change |
| `PruneDataChanges` | `at < cutoff` | `at < cutoff AND seq <=
LEAST(mark, first young seq - 1)`: removes only a run of the oldest
numbers |
| feed held back by | any open transaction with an xid, anywhere on the
server | only an open transaction that records a change, in this
database |
Lock key: the number's two 32-bit halves, in the two-integer key space.
The only other two-integer locks here (`credentialLockNamespace` 839,
`providerAppLockNamespace` 872) would read as numbers from 839 << 32 up,
which no feed reaches. They are also above the sequence value, so they
never lower the mark. A transaction-local setting makes the trigger take
the lock once per transaction, not once per row.
Migration `20261214130000_data_changes_in_flight.sql` is
`20261207100100`'s function plus this lock (expand-only). Its Down
restores `20261207100100`'s function.
## Changes
- `acceleration/migrations/20261214130000_data_changes_in_flight.sql`:
the trigger takes the lock.
- `acceleration/internal/store/datamove.go`: `changeWatermark` is a
method. `Changes`, `ExportCustomer` and `PruneDataChanges` read it
before their own statements. Expiry is gated on the mark.
- `acceleration/internal/store/credentials.go`: the lock-key comment
names the other two-integer locks.
- `acceleration/README.md`: states the guarantee that holds now.
`CHANGELOG.md`: one Bug Fixes entry.
- First production caller: `router replicate --once/--resume` → `GET
/v1/data/changes` (`internal/api/datamove.go` `listDataChanges`) →
`Store.Changes`.
## SQL changes
<table>
<tr><th>Before</th><th>After</th></tr>
<tr><td>
```sql
DELETE FROM data_changes
WHERE at < now() - make_interval(secs => ?)
```
</td><td>
```sql
DELETE FROM data_changes
WHERE at < now() - make_interval(secs => ?)
AND seq <= LEAST(?, (SELECT MIN(seq) - 1
FROM data_changes
WHERE at >= now() - make_interval(secs => ?)))
```
</td></tr>
</table>
Measured on a local test database: 200k rows, half older than 7 days,
`EXPLAIN (ANALYZE, BUFFERS)` inside a rolled-back transaction. The query
runs hourly.
<details><summary>Before: 29.9 ms, shared hit=100658</summary>
```
Delete on data_changes (actual time=29.684..29.685 rows=0 loops=1)
Buffers: shared hit=100658
-> Index Scan using data_changes_at_idx on data_changes (rows=99359)
Index Cond: (at < (now() - '168:00:00'::interval))
```
</details>
<details><summary>After: 44.1 ms, shared hit=105660</summary>
```
Delete on data_changes (actual time=44.030..44.034 rows=0 loops=1)
Buffers: shared hit=105660
InitPlan 3: Limit -> Index Scan using data_changes_pkey (Filter: at >= ..., Rows Removed by Filter: 99359), shared hit=4454
-> Index Scan using data_changes_pkey on data_changes (rows=99359)
Index Cond: (seq <= LEAST($0, $2))
Filter: (at < (now() - '168:00:00'::interval))
```
</details>
Result: about 5% more buffers and +14 ms per hourly prune. The `MIN`
walks the rows that are about to be deleted.
## Validation
| Test (`internal/store/datamove_test.go`) | Defect it catches | Base
dd97944 |
|---|---|---|
| `TestAChangeOfATransactionThatCommitsLateIsNotSteppedOver` | the
ticket's sequence: a newer transaction's lower number is stepped over |
fails |
| `TestChangesInFlightForSeveralCustomersHoldEveryFeedBack` | three
transactions of two customers, committed out of order; the highest lock
used instead of the lowest | fails |
| `TestAnExportCursorStaysBelowAChangeInFlight` | the export cursor
passes a change in flight (on a sequence that has handed out nothing
yet) | fails |
| `TestAChangeInFlightRightAfterTheCursorDoesNotExpireIt` | a false 410
when everything up to the cursor was pruned and the number right after
it is still in flight | not run on base; the base's expiry rule on this
branch (mutation G10) and `after <= mark` (G11) both fail it |
| `TestAPruneBetweenTheTwoReadsOfAFeedDoesNotLoseRowsAfterTheCursor` |
rows after a cursor dropped by a prune between the kept check and the
rows read, the follower jumping over them with no 410 | fails with the
rows read outside the transaction (mutation: two separate reads) |
| `TestANumberRolledBackRightAfterAnExportCursorIsNotAPrunedChange` | a
false 410 when the export cursor is the mark on a table with no change
kept and the number after it was rolled back | passes |
| `TestAChangeInFlightIsHeldBackWhateverTheHalvesOfItsNumber` | a lock
key whose low half loses its sign bit or whose high half is dropped, in
the trigger or the reader | fails |
| `TestTheMigrationComesOffAgain`
(`data_changes_in_flight_migration_test.go`) | a Down that does not
restore the previous function | n/a |
| `TestAnOpenTransactionThatRecordsNothingDoesNotHoldTheFeedBack` | a
lock taken for rows nobody captures | fails |
| `TestAChangeInFlightInAnotherDatabaseDoesNotHoldTheFeedBack` | locks
of another database counted | fails |
| `TestPruningKeepsAChangeNumberedAboveOneStillKept` | pruning by `at`
alone | fails |
| `TestPruningKeepsWhatIsNumberedAboveAChangeInFlight` | pruning past
the mark | fails |
| `TestAQuietFeedHandsOutEveryChangeUpToTheNewest` (control) | a mark
held below the newest change with nothing open | passes |
The AI-2683 expiry tests pass unchanged. Suites run on the branch: store
`DataMove|Changes`, api `TestDataMoveSuite`, cmd/router
`Replicate|RouterStart`. Mutations of the trigger, the reader, the
expiry gate, the prune, the export cursor and the Down were each caught
by at least one test above. Out-of-repo probe: 12 writers in overlapping
transactions while a follower polls two customers, 10 runs, every
recorded change handed out each run.
Not tested deterministically, because a test cannot pin the timing:
reading the mark inside the export transaction, or after the rows'
snapshot. Both are argued above.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why Since AI-2538 (#1674) the router refuses a non-empty `plugins`, `plugin_events` or `mcp_servers` with a 400 and reads none of them, and wave 35 deleted the code behind them. The store model and the spec still carried their old types, so every generated client still had `PluginEntry`, `PluginWithOptions`, `PluginEvent`, `McpServer` and `McpServerBranding`. This removes them; the refusal stays exactly as it was (AI-2772, part of AI-1757). ## How it works ``` request body (create / update / patch / sync) ├─ plugins: [...] -> *[]retiredPlugin items: string | object ├─ plugin_events: [...] -> *[]map[string]any items: object └─ mcp_servers: [...] -> *[]map[string]any items: object │ ├─ wrong shape ([5], "x", ["x"] for events/servers) -> 400 validation_failed (schema) └─ retiredComplaint: any non-empty list -> 400 invalid_request, same text [] / null / left out -> saves as before store.AgentConfig agent_configs row ├─ Plugins (gone) plugins JSONB NOT NULL DEFAULT '[]' stays until C1 ├─ PluginEvents (gone) plugin_events JSONB NOT NULL DEFAULT '[]' (AI-1792) └─ MCPServers (gone) mcp_servers JSONB NOT NULL DEFAULT '[]' ``` | What goes | What stays | | --- | --- | | `api/plugins.go` (`PluginEntry`, `PluginWithOptions`, `PluginEvent`, `McpServer`, `McpServerBranding`), `mcpBrandingTimeout` (no caller) | the three request fields, deprecated, and `retiredComplaint`'s texts (`configs.go:41-80`) | | `store.AgentConfig.Plugins/PluginEvents/MCPServers`, `store.PluginEntry/PluginEvent/MCPServer/MCPBranding`, their `configColumns` names and nil-to-empty lines | the three columns: an insert gives them `[]`, an update no longer touches them, no code reads them | | the five schemas in `openapi.yaml` and in every generated client | datamove copies `agent_configs` rows column by column (`to_jsonb` / `jsonb_populate_record`), so it carries the columns as before | ## What a request answers, base vs head Probe on dd97944 and on this branch, POST/PUT/PATCH configs and POST sync answer alike: | Sent | Base | Head | | --- | --- | --- | | `"plugins": ["linear"]`, `[{"name":"linear"}]`, any non-empty events/servers of objects | 400 `invalid_request`, retired text | same | | `"plugins": [1]`, `[null]`, `"x"`, `{}`; events/servers `[1]`, `["x"]`, `"x"` | 400 `validation_failed` | same | | `"plugins": [{}]`, `[""]`; `"plugin_events": [{}]`; `"mcp_servers": [{}]` | 400 `validation_failed` (old item schema) | 400 `invalid_request`, retired text | | left out, `null`, `[]` | saves | saves (`TestARetiredKeyThatNamesNothingSavesAsOnBase`) | ## Changes - Store and API types as above; `retiredPlugin` is a `json.RawMessage` with an inline `oneOf: [string, object]` schema, so a number in `plugins` is still a schema error. - Tests that wrote a legacy row through the removed fields write the columns by SQL (`nameRetired`, `configs_test.go`); the patch/sync test now checks that the read shows none of the keys, since a save no longer rewrites the columns. - `openapi.yaml` and the Go, Python (`plugins/stream`), JavaScript, .NET, Ruby, Rust and PHP clients regenerated; Kotlin, Swift and Dart generate only client-accessible operations and are unchanged (`generate.py`, `--check`). - `.claude/skills/sdk/SKILL.md`: the plugin and `mcp_servers` paragraphs folded into one "removed" note, and a note at the bottom; CHANGELOG Breaking Changes line. ## Validation | Test | Catches | | --- | --- | | `TestAnEntryOfEitherShapeABaseSaveTookIsRefusedAsRetired` (new) | a `plugins` item schema that drops the string or the object form | | `TestAPluginEventOrMCPServerThatIsNotAnObjectIsRefusedByTheSchema` (new) | `plugin_events` / `mcp_servers` items typed as anything | | `retired_keys_test.go`, `plugins_gone_test.go` (unchanged but for the patch/sync check above) | the refusal on each write, its texts, `[]`/null/left out saving | | `TestUpdatingAConfigWritesEveryFieldOfIt` | `configColumns` and the model disagreeing | Both new tests pass on dd97944 too. Every condition in `retiredComplaint`, each call site, the item schemas and `configColumns` were mutated and each mutation failed a test. Ran: api `ConfigsSuite`, `SyncSuite`, `PluginsGoneSuite`, `SessionConnectorsSuite`; store `StoreSuite`, `DataMoveSuite` and the unit tests; `go build`/`go vet` (with and without `integration`); Go SDK, JS (`npm test`), `plugins/stream` tests, PHP (phpunit, phpstan, `--check`), Ruby (`rake`), Rust (`cargo test`, clippy, fmt, `--check`), .NET (`--check`, `dotnet test`), Dart `--check`, Swift `--check`, Kotlin regen. Each SDK's agent.yaml refusal reads raw keys and none used a removed type outside generated code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
Volt's staff Usage tab lists an organization's usage through the staff
gateway. The gateway refuses `api_key` in a staff call's query ("a staff
call names no api_key"). The usage service reads the key filter only as
`api_key` (`internal/usage/server/manage.go:684`) and ignores
`api_key_id`, so `?api_key_id=<key>` answers every key's events with no
error. Staff cannot filter usage by key at all. #1726 renamed the same
filter on the router's own operations. This PR does the same on the
usage service.
## How it works
```
GET /v1/manage/accounts/{org}/usage?... (listUsage, staff)
GET /v1/accounts/{org}/usage?... (readAccountUsage, same input)
├─ api_key_id=K -> events of key K (new)
├─ api_key=K -> events of key K (alias, 1 release)
├─ api_key_id=K & api_key=K -> events of key K
├─ api_key_id=K & api_key=J -> 400 naming both
└─ neither (or both empty) -> every key's events (unchanged)
```
`api_key` stays readable for one release. Reasons: the router and usage
pods roll out together in one release, and the router's own client still
sends `api_key` (`internal/usage/customer.go:212`). This PR does not
switch that client. If it did, a new router talking to an old usage pod
during rollout would get unfiltered rows.
## Changes
- `listUsageInput` gains `api_key_id`. `api_key` is marked `deprecated`.
`readAccountUsage` uses the same input, so it gets both.
- `internal/usage/server/openapi.yaml` is regenerated with `go run
./cmd/usage openapi`. The router's `api/openapi.yaml` and the clients do
not change: the usage service spec is not a client generator input.
- CHANGELOG entry under Bug Fixes.
## Validation
| Test (`ServerSuite`, both endpoints in each) | Catches | On base |
| --- | --- | --- |
| `TestListUsageFiltersByAPIKeyID` | `api_key_id` is ignored; a key
named twice with the same value is refused; an empty `api_key_id`
filters | fails (2 rows, unfiltered) |
| `TestListUsageStillFiltersByTheOldNameAPIKey` | the alias is dropped;
an empty `api_key_id` beside it is refused | passes (control) |
| `TestListUsageRefusesTwoDifferentKeys` | two different keys pass, or
the 400 does not name both | fails (200) |
Mutation checks (9): each half of the `cmp.Or`, the conflict case
removed, each of its three conditions dropped, the query tag renamed,
and the message. Each fails one of the tests above, except swapping the
`cmp.Or` order. That mutant is equivalent: the order only matters when
both names hold different keys, and that case is refused first.
`go test -tags integration ./internal/usage/...` passes on the branch
merged with `accelerate`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why Four follow-ups from the review of #1745, all in the router's ID guard `unfoundID` (`acceleration/internal/agent/ids.go`), which runs for every tool call (`internal/agent/telephony.go:646`): - **AI-2798.** A short part of a link the person wrote (`1` from `?page=1`, `2024` from `/docs/2024/`) counted as an ID of any kind. Before #1745 it was refused. - **AI-2799.** In a shared channel the person's text reaches the model inside a JSON envelope (`internal/conversation/conversation.go:1214`), and `json.Marshal` writes `&` as `\u0026`. The link regex stops at the backslash, so every query value after the first was lost. A link escaped for HTML (`&`, `<…>`) broke the same way. - **AI-2800.** A line that names one kind could give another kind's ID: in `Channel #x by U0…`, `U0…` passed as a `channel_id`. - **AI-2801.** The echo check compared the ID with the raw JSON text of the call's arguments. A query the model wrote with escapes (`"\u0043\u0030FAKE01"`) did not match, so a result that wrote the query back let it pass. ## How it works ``` unfoundID: a *_id argument that a tool hands out ├─ a link part in a person's message │ ├─ NEW: the message is read as written: JSON envelope │ │ decoded, HTML entities undone (AI-2799) │ └─ NEW: counts only if it mixes letters and digits (AI-2798) │ "C0EX4MPL1" yes; "1", "2024", "general" no │ (a number still counts where the text names its │ kind: ".../cases/48213", the existing rule) ├─ a line of text in a JSON tool result │ ├─ NEW: the ID stands beside the word for its kind, │ │ at most one word (the thing's name) and "ID" │ │ between, or, after a "Kind:" label, a name of │ │ any length with the ID in brackets (AI-2800) │ └─ not an echo: the call's arguments, NEW: decoded, │ numbers as written, lists and keys included (AI-2801) └─ other rules unchanged ``` | Line in a tool result | `channel_id` | Base | Head | |---|---|---|---| | `1. #help (C0…) - public_channel - Creator: Ana Lind - 2026-01-02 - Not Archived` | `C0…` | given | given | | `Channel: #help (C0…)` | `C0…` | given | given | | `Channel: #help (ID: C0…)` | `C0…` | given | given | | `Channel: Group DM (ID: C0…)` | `C0…` | given | given | | `Channel #x by U0…` | `U0…` | given | refused | | `Creator: Ana Lind (<@u0…)` after a listed channel | `U0…` | given | refused | | `1. #help (C0…) - public_channel - created by U0…` | `U0…` | given | refused | | `U0… wrote in the #help channel` | `U0…` | given | refused | The real shapes in the first three rows are from Slack MCP results in local Claude Code transcripts (`slack_search_channels` lists, `slack_read_channel` headers), with IDs and names removed. The rule names no vendor or format. It works from the order the line writes things in: kind, name, ID. Why "letters and digits" for a link part: a number alone in a link is as often a page, a year or a size as an ID, and letters alone are a word (a name or a section). Neither says what it is, so neither is an ID of a kind the link leaves unnamed. ## Changes - `ids.go`: `linkParts` keeps only parts that mix letters and digits. New `asWritten` returns the keys and values of a JSON text, numbers as written. It is used for the links in a person's message (after `html.UnescapeString`) and for each call's arguments in the echo check. New `besideKind` replaces "the line contains the kind word". `idWords` is the word split `holdsValue` already used, now shared. - `ids_test.go`: `TestOnlyALinkPartOfLettersAndDigitsIsAnIDOfAnyKind`, `TestALinkIsReadAsThePersonWroteIt` (the envelope is built with `json.Marshal`, as the shared channel builds it), `TestAWrittenLineGivesOnlyTheIDBesideTheWordForItsKind`, `TestAnArgumentSentEscapedIsStillAnEcho`. ## Validation | Case | Base f82b598 | Head | |---|---|---| | `?page=1` → `case_id 1`, `/docs/2024/` → `2024`, `/archives/general` → `general` | given | refused | | `/cases/48213` → `case_id 48213`; `C0EX4MPL1` in path or query | given | given | | link inside a `json.Marshal` envelope, `&`, `<…>` | refused | given | | link as a JSON key; envelope with no link; HTML-escaped link the agent wrote | given / refused / refused | same | | the four lines above that give another kind's ID | given | refused | | `{"query":"C0FAKE01"}` or `{"queries":["help","C…"]}` echoed | given | refused | | a number query echoed; arguments that are not JSON echoed | refused | refused | Base column: the new tests run against `ids.go` from f82b598. Exactly the rows marked as changed fail there. All #1745 tests pass on head. `go test ./internal/agent` passes (155.8 s), and `go vet` and `gofmt` are clean. 21 mutations were run, one per changed condition, and every one was killed. Among them: `&&` → `||` and the letter-only and digit-only variants; no HTML unescape; raw content; keys dropped; joined with no separator; raw arguments; no `UseNumber`; non-JSON dropped; lists not walked; numbers dropped; `<= 1` → `<= 2` and → `<= 0`; the word `ID` counted; dashes counted as words; kind of one word only; the ID-before-kind branch dropped; kind word must be whole; the old "kind anywhere" rule. Not narrowed: `v2` in `/api/v2/` mixes a letter and a digit, so it still counts. Refusing it would need a length or a version pattern, which is a tuned threshold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why `router replicate --once` calls `GET /v1/data/export` (`acceleration/internal/api/datamove.go:50` `exportData`). That handler commits a `data_change_capture` row (`Store.StartDataCapture`) and then reads a REPEATABLE READ snapshot (`Store.ExportCustomer`). The capture trigger `record_data_change` checks for that row in its own query, which runs after the row is written. The function is VOLATILE, so under READ COMMITTED each of its queries takes a new snapshot ([Postgres docs](https://www.postgresql.org/docs/current/xfunc-volatility.html)). A write whose check ran before the capture row committed records nothing. If that write was still open when the snapshot was taken, it was in neither the export nor the changes after it, and the new deployment never got it. A probe on base shows this: the export answered 200, and the write was in neither the export nor the changes. ## How it works ```mermaid sequenceDiagram participant Writer as Writer tx (READ COMMITTED) participant PG as Postgres (shared DB) participant Export as GET /v1/data/export Writer->>PG: INSERT agent_configs (takes xid + its lock) Writer->>PG: trigger checks data_change_capture: no row, records nothing Export->>PG: INSERT data_change_capture, COMMIT Export->>PG: pg_locks transactionid of this DB's backends Note over Export: before: the snapshot was read here and missed the write Writer->>PG: COMMIT (xid lock released once the commit is visible) Export->>PG: poll until those xids are gone (at most 30s, else 503) Export->>PG: watermark + REPEATABLE READ snapshot, with the write in it ``` Why it holds: ``` a writer W of the app ├─ W's capture check ran BEFORE the capture commit │ └─ W took its xid and xid lock before writing the row, so before the check │ -> W is in the set read after the commit -> the export waits for W -> W is in the rows └─ W's check ran AFTER the capture commit (a fresh snapshot per query) └─ W sees the capture row -> its change is recorded -> AI-2741's rule keeps the cursor at or below it (cursor <= lowest in-flight lock) ``` - Only this database's backends are read (`pg_stat_activity.datid`). Transaction ids are shared by every database on the server, and another database's writes have nothing to do with this one. - Shards are not waited on: `data_change_capture` is in the shared DB, and a shard's tables record no changes (`watchDataChanges`, `internal/store/datamove.go`). - Every write here is READ COMMITTED. The only REPEATABLE READ transactions in `internal/store` are read-only (`grep -rn LevelRepeatableRead`). - No migration. The trigger, the write path and `GET /v1/data/changes` are unchanged. | Case | Before | After | | --- | --- | --- | | Write open when the export starts, commits after | in neither | waits, write is in the rows | | Write still open after 30s (any app) | 200, write lost | 503 "still open: try again" | | Nothing open | 200 | 200, one `pg_locks` read, no pause | | Open write in another database on the same server | n/a | not waited on | The bound is 30s, twice `shippingIdle` (`internal/store/shipping.go`), the longest the router lets one of its own write transactions sit idle. ## Changes - `Store.WaitForOpenWrites(ctx, within)` and `ErrWritesOpen` (`internal/store/datamove.go`). - `exportData` calls it after `StartDataCapture`. `ErrWritesOpen` answers 503 `unavailable`; the Server field `exportWritesWait` defaults to `exportWritesWait` (30s). - README (data move section): the guarantee. CHANGELOG: Bug Fixes. ## Validation Suites run on this branch (base `f82b5987a` is current `accelerate`): `./internal/store/ -run 'DataMove|Changes'`, `./internal/api/ -run TestDataMoveSuite` and `./cmd/router/ -run Replicate` all pass. | Test | Defect it catches | | --- | --- | | api `TestAWriteOpenWhenAnExportStartsIsInTheExportOrItsChanges` | the write is in neither the export nor the changes (fails on base) | | api `TestAnExportWaitsForAWriteOpenWhenItStartedToCommit` | the export answers before the open write commits | | api `TestAnExportGivesUpOnAWriteThatStaysOpen` | an unrelated long transaction hangs the export, or the answer is not a 503 | | store `TestWaitingForOpenWritesHoldsAWriteFromBeforeTheCaptureStarted` | the wait returns while the write is open, or ignores its bound | | store `TestWaitingForOpenWritesReturnsAtOnceWithNoneOpen` | the wait pauses when nothing is open (control) | | store `TestWaitingForOpenWritesIgnoresATransactionThatOnlyReads` | a reader without an xid holds the export | | store `TestWaitingForOpenWritesIgnoresAnotherDatabase` | another database's writes hold the export | Mutation checks: each of these breaks a named test above: no wait in `exportData`, the wait returns at once, no `datid` filter, no `locktype` filter, a poll that never refreshes, no bound, the bound ignored, 503 mapped to 500, the default bound unset, and no early return when nothing is open. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why Beside a sensitive connector such as Nessy, a config may grant another connector's tool without `require_approval` only when that connector's manifest lists the tool in `read_only_tools` (`bindingSendsOut`, `acceleration/internal/api/configs.go`). Twelve MCP manifests listed none, so every read of Cal.com, GitHub, Notion, Sentry and the rest asked a person. #1175 and #1740 marked seven connectors; this marks nine of the twelve, from each vendor's tool reference or server source, and says why the other three list none. ## How it works ``` POST /v1/agents/configs (nessy + another connector's binding) └─ SensitiveBindingsComplaint └─ bindingSendsOut(binding, latest manifest) ├─ tool in source.read_only_tools ─> reads: accepted └─ any other tool, or a tool added later ├─ in require_approval ─> accepted └─ else ─> 400, names the binding and the tool GET /v1/agents/connections/{id}/tools ─> read_only: true for a listed tool ``` A config with no sensitive connector is unchanged. `ReadsAsConnection` ignores `read_only_tools`, so connections pinned to the old revisions stay current and need no reconnect. | Connector | Revision | Listed | Source (opened 2026-11-05) | Left out besides writes | | --- | --- | --- | --- | --- | | Cal.com | 2 → 3 | 41 of 72 | cal.com/docs/mcp-server «Available tools» | `search_docs`, `find_api_operation` (free text to public docs and API catalog), `call_api_operation`, `calculate_routing_form_slots` (page does not say if the response is stored) | | Calendly | 2 → 3 | 27 of 38 | developer.calendly.com/docs/mcp/supported-tools: each tool's REST endpoint; GETs listed | `shares-create_share`, `scheduling_links-create_single_use_scheduling_link` (a link anyone may open) | | GitHub | 9 → 10 | 30 | github-mcp-server@99d6d65: README toolsets default + actions, `ReadOnlyHint: true` in pkg/github and __toolsnaps__ | every `ReadOnlyHint: false` tool | | Gong | 2 → 3 | 1 of 3 | help.gong.io «The MCP server is read-only» | `ask_account`, `ask_deal` (the model's question goes to Gong's AI) | | HubSpot | 1 → 2 | 18 of 32 | developers.hubspot.com remote MCP «Available tools» | `query_crm_data` (model-written SQL, functions unlisted), `submit_feedback`, every `manage_` | | Linear (own app) | 2 → 3 | 42 | linear.yaml's list: same server, mcp.linear.app | as linear.yaml | | Metabase | 2 → 3 | 11 of 23 | metabase.com/docs/latest/ai/mcp-tools: each tool marked «Read-only.» | none offered: the 12 others need scopes it never asks for | | Notion | 1 → 2 | 31 of 71 | developers.notion.com tools-faqs list + reference pages | `notion-ai-search`, `notion-connector-search`, `notion-search` (AI search across connected sources), and the five `notion-calendar-list-*` tools (they read connected Google or Outlook calendars outside Notion) | | Sentry | 1 → 2 | 40 of 76 | sentry-mcp@02ca9bf toolDefinitions.json, `readOnlyHint: true` in tools/catalog | natural-language `search_*` (an embedded agent sends the question to a model provider), `search_docs`, `get_doc` | Unchanged, with the reason here rather than a guess in the manifest: | Connector | Why no list | | --- | --- | | Instacart | both tools (`create-recipe`, `create-shopping-list`) make a page and return a link anyone may open | | Shopify | its one tool sends the model's `query` and `context` to the shop, another business | | Salesforce | the tool reference (developer.salesforce.com hosted-mcp-servers) answered 403 to curl and WebFetch; the list is unverified | Each YAML comment cites the page and date and says why each listed tool only reads, as #1740 did. Judgement calls follow #1740: a signed download URL brings data in (`get_attachment` precedent: Notion `notion-get-file-download-urls`, GitHub `get_job_logs`, Sentry `get_event_attachment`); a search inside the account's own vendor is a read (Slack precedent: GitHub `search_*`); free text to public docs is out (`search_documentation` precedent). ## Changes - `read_only_tools` and a revision bump in nine manifests under `acceleration/internal/connectors/providers/`; goldens for calcom, calendly, github and gong. - Tests that follow the bumps: `TestGitHubShowsWhatASandboxGetsForItsAPI`, the github and linear_app tests in `providers/sandbox_test.go`, `TestLinearAppConnectsWithTheCustomersClientAtItsPinnedEndpoints`, `TestMetabaseRevisionTwoSeedsOverTheRevisionOneTheBuildBeforeStored`. ## Validation | Test | Defect it catches | | --- | --- | | `TestConfigsSuite/TestNessyBesideOnlyTheReadOnlyToolsOfTheOtherMCPConnectorsIsAccepted` | a listed tool dropped from any of the nine (fails on the base manifests) | | `TestConfigsSuite/TestNessyBesideAToolTheOtherMCPConnectorsLeaveOutNamesExactlyThoseTools` | any left-out tool of HubSpot, Notion, Sentry, Gong, or a judgement-call tool of Cal.com, Calendly, GitHub, added to a list | | `TestConfigsSuite/TestAConfigWithoutASensitiveConnectorKeepsTheWriteToolsOfTheOtherMCPConnectors` | control: 201 on base f82b598 and on head | | `TestToolsetSuite/TestLinearAppListsTheReadOnlyToolsLinearDoes` | linear_app's list drifting from linear's | | `TestToolsetSuite/TestEveryToolMetabaseOffersOnlyReads` | Metabase listing a tool it does not offer, or offering one it does not list | | `TestStoreSuite/TestTheReadOnlyToolsSeedOverTheRevisionsTheBuildBeforeStored` | a list added without a revision bump (the seeder would refuse the edit) | | `TestTheBaseBuiltInsMarshalAsTheyWereStored` | any change to the calcom, calendly, github or gong list | 22 mutations (19 with one tool removed or added, 3 with a revision bump undone), each on a fresh database: every one fails at least one test above. Run: `go test ./internal/connectors/... ./internal/store`; `-tags integration` `TestConfigsSuite`, `TestConnectorsSuite`, `TestStoreSuite`, `TestOpenStoreSuite`, the connection and OAuth client suites. Unverified: that the hosted Sentry and GitHub servers serve exactly the source at the shas read (a listed name the server does not serve grants nothing); whether Cal.com stores a `calculate_routing_form_slots` response; HubSpot's SQL functions; Salesforce's tool list. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
What a person does in a reply's generated UI (a tapped button, a
submitted form) reaches the model only when it arrives as `ui_action` on
`POST /v1/agents/sessions/{id}/responses`; a plain message is answered
from its text alone. Go, Swift, JavaScript (#1711) and Kotlin (#1722)
send one. Dart's public `Responses.create` could not, so a Flutter app
showing A2UI or OpenUI replies (`stream_chat_flutter_ai`'s `AIUIAction`)
had no way to hand the form's values to the agent.
## How it works
```
AIUIAction tapped in the Flutter app
└─ session.responses.create(action.label, uiAction: action.toJson())
└─ POST /v1/agents/sessions/{id}/responses
{ text: label, request_id, ui_action: { v, message_id, format, name, payload } }
└─ router: the person's message carries it as custom.ai_ui_action,
and the model is told it after their words
```
| Change | Result | Test (`sdks/dart/core/test/client_test.dart`) |
| --- | --- | --- |
| `Responses.create(..., uiAction: Map<String, Object?>?)` | sent as
`ui_action`, unchanged, nested payload included | `sends what the person
did in a reply's UI with their words, still under a request id` |
| An empty `uiAction` | not sent, as in JavaScript (the router would
answer 400) | same test |
| Every question already carries a `request_id` | the router keeps the
action on the message | same test |
| | JavaScript | Kotlin | Swift | Dart (this PR) |
| --- | --- | --- | --- | --- |
| Empty action | not sent | sent, 400 | sent, 400 | not sent |
| Client-side checks | none | none | none | none: the router checks the
8 KB limit and `message_id`, `format`, `name` |
CHANGELOG and the `sdk` skill now list Dart's call.
## Validation
- In `sdks/dart/core`: `dart format --set-exit-if-changed`, `dart
analyze`, `dart run tool/generate.dart --check` and `dart test` (136
pass), with the local Dart SDK rather than the Docker image.
- The new test fails when the empty-map guard is removed (an empty
`ui_action` is sent) and when `uiAction` is not passed to the request.
- Not checked against a live router or from a Flutter app.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why A call placed with `POST /v1/phone/calls` got its `calls` row from the `phone` the client later sent to `POST /v1/sessions`. A client that sent none left the row `inbound` with no numbers. The SDKs send the from number and vendor call id, but never the number rung, so `to_number` was always empty. Call history and anything split by direction were wrong for outbound calls. The router already keeps what it dialled in `phone_calls`. `StartCall` now reads it: if the router placed a call into this Stream call for this customer, the row is `outbound` with that call's local and remote numbers. Inbound calls never have a `phone_calls` row, so they are stored as before. Example: place `+15125550100 → +15125550199`, open the session with no `phone`: | | direction | from_number | to_number | |---|---|---|---| | before | inbound | | | | after | outbound | +15125550100 | +15125550199 | Linear: AI-1323
…1752) ## Why On an inbound call, `InboundCall.caller_number` came as `00<country><number>` when the carrier wrote the number that way. Every other number in the API is E.164, so a lookup by the caller's number missed. Billing had the same gap: an inbound leg stored `00…` as its remote number, and a phone joining as `sip-00…` matched no leg placed to its `+…` number, so it could take another number's leg. The call hook now reads a phone's number once, through `omnichannel.Phone` (the contact map's normalizer), for the worker, the inbound leg and a joining phone's leg. A number that does not say it is international is kept as it came. Example: SIP participant `sip-00442079460018` reaches the worker, and is billed, as `+442079460018`. Fixes [AI-1324](https://linear.app/stream/issue/AI-1324)
…lack (#1755) Linear: AI-1918 The operator now hears, in a Slack channel, the first time each organization reaches a money limit: - refused at its credit; - refused at Stream's spend hard limit, for the day or the month; - refused at one of its own spend limits; - in `shadow`, the first time it would have been refused at any of these. **How it works** - `policy` reports every money refusal (and every shadow would-refuse) of a billed organization through a new `Settings.LimitHit` callback. Number purchases report theirs too. Suspensions, user limits and unreadable money checks are not reported. - `internal/limitnotice` takes each hit without blocking and dedupes it in memory. It writes a `limit_notices` row per organization and kind (`no_credit`, `spend_hard_limit`, `spend_limit`), using `ON CONFLICT DO NOTHING`. Only the router that wrote the row posts it with `chat.postMessage`. - A post that fails leaves `posted_at` empty. A sweep, every minute, claims rows whose claim is over 5 minutes old (`FOR UPDATE SKIP LOCKED`) and posts them again. - Each message names the environment (`SENTRY_ENVIRONMENT`), the organization, its tier, the app and the refusal as the caller was answered. - It's configured with `ROUTER_LIMITS_SLACK_TOKEN` and `ROUTER_LIMITS_SLACK_CHANNEL`. Either unset, `ROUTER_LIMITS_MODE=off`, or no Postgres turns it off. New migration: `20261215090000_limit_notices.sql`. **Tests** - `internal/limitnotice`: one post per kind however many refusals; another router finds the row written; a hit that couldn't be written isn't posted; the message format; the Slack client. - `internal/store` (integration): a notice is written once per organization and kind; claiming honours a fresh claim and skips posted rows. - `internal/policy` (integration): enforce reports `no_credit` as enforced, shadow reports it as not enforced, a suspension reports nothing, and the reason-to-kind mapping. - The full `internal/policy` and `internal/store` integration suites pass, and so do `internal/config` and `cmd/router`.
…1756) ### Goal Fixes [AND-1861](https://linear.app/stream/issue/AND-1861/juno-a-reopened-conversation-changes-model-and-a-failed-turn-shows): a conversation reopened from the drawer answered on the agent's default model instead of Grok, and a failed turn showed nothing. ### Implementation - `ChatViewModel` sends the chat model as `ModelOverwrites(llm = Assistant.CHAT_MODEL)`. The router stores overwrites on the session and restores them on reopen; it doesn't do that for the top-level `llm`. - `AgentChat` follows the session's events: an `error` from the model leaves the latest question unanswered, and the next reply clears that. A question the router refuses is unanswered too. - `ChatScreen` shows "Juno couldn't answer." under the question with Try again, which asks the question again or resends the action. The provider's raw error isn't shown. ### Testing `./gradlew :app:testDebugUnitTest` (5 tests in `UnansweredTest`). On a Pixel emulator against a local router: a reopened conversation answers on Grok; a pre-fix conversation still on Gemini (402) shows the message, and Try again sends a second `POST /responses`, as seen in the router log.
) ## Why `POST /v1/phone/calls/{vendor_call_id}/digits` sent the digits to whatever call id it was given. Vendor accounts are shared across customers, so a customer who learned another customer's call id could press keys on that call. It also answered a real id (204) differently from a wrong one, which confirmed guesses. Now the call must be a leg the customer placed: a placed call or a transfer, found in `call_legs` by their customer id, the vendor and the vendor call id. The vendor call id is kept on the leg when it opens (migration `20261215120000_call_legs_vendor_call_id.sql`, a nullable column and a concurrent index). Otherwise the answer is a 404, the same for another customer's call and for an id nobody placed, and nothing reaches the vendor. An agent's press tool in a session goes through the same check. ``` POST /v1/phone/calls/v3:someone-elses-call/digits {"vendor":"telnyx","digits":"1"} 404 {"error":{"type":"not_found","message":"No call with this vendor_call_id was placed from here.", ...}} ``` Fixes [AI-1319](https://linear.app/stream/issue/AI-1319/phone-pressing-digits-does-not-check-the-call-belongs-to-the-customer)
) ## Why Four review nits of #1747 in the router's ID guard `unfoundID` (`acceleration/internal/agent/ids.go`). The guard runs for every tool call (`internal/agent/telephony.go:646`). - **AI-2820.** The word for a kind matched inside a longer word. With `#ops-channel by U…`, `U…` passed as a `channel_id`. The value `public_channel` (a listed channel's type) also passed as a channel ID. - **AI-2821.** Two mutations survived: HTML unescape before the JSON decode, and the word "ID" matched with `Contains`. Each now has a row that kills it. - **AI-2822.** A detailed channel record can give the channel ID only in its `Permalink:` link. The guard refused that ID. This was pre-existing. - **AI-2823.** The label rule could not tell `Channel: Group DM (ID: C…)` apart from `Channel: Ana Lind (ID: U…)` or `Channel: #help owner (U…)`. This was not a regression: base gave the same answers. ## How it works ``` an ID argument, after the caller / link / operator checks ├─ part of a link a successful tool returned NEW (AI-2822) │ same reading as the person's links (linkParts) │ not: a part the call itself was sent (echo) ├─ under its key or "id" in a JSON result unchanged └─ on a line a JSON result writes out ├─ label of the kind, then name, then (ID) │ label is named by its LAST word (AI-2820) │ "Channel owner: Ana (U…)" -> an owner ├─ some line labels the ID as another thing: only a LABEL is doubted NEW (AI-2823) │ a line beside the kind still gives it; a line whose call was │ sent the ID (its echo) labels nothing └─ kind word and the ID side by side after the kind: at most one word between (a name) before the kind: nothing between (review) "U0… joined channel #help" -> not given kind word is a word of its own (AI-2820) "_" splits a key: public_channel, channel_id "-" and "#" keep a name: #ops-channel, #team_channel plural counts: "Channels:" the ID's own word is not its kind ``` The AI-2823 rule: an ID is the ID of one thing. A line that labels the ID as something else (`From:`, `Participants:`, `Creator:`) means no other line gives it as this kind. The rule needs no names of vendors or ID formats. `Channel: Ana Lind (ID: U…)` with nothing else in the result is still given, because nothing in the result says `U…` is a person. | Shape (tool result line) | Argument | Base | Head | |---|---|---|---| | `#ops-channel by U0ANA001` | channel_id U0ANA001 | given | refused | | `#team_channel by U0ANA001` | channel_id U0ANA001 | given | refused | | `Ops-channel: Ana Lind (ID: U0ANA001)` | channel_id U0ANA001 | given | refused | | `1. #help (C0HELP002) - public_channel` | channel_id public_channel | given | refused | | `Channel: Ana Lind (ID: U0ANA001)` + `From: Ana Lind … (ID: U0ANA001)` | channel_id U0ANA001 | given | refused | | `Channel: #help owner (U0ANA001)` + `Participants: Ana Lind (ID: U0ANA001)` | channel_id U0ANA001 | given | refused | | `U0ANA001 joined channel #help` | channel_id U0ANA001 | given | refused | | `#help (C0HELP002) - public_channel` | channel_id C0HELP002 | given | given | | caller: "The showcase number is 6631." | case_id 6631 | given | refused | | caller: `case#6631`, `ticket-4521`, `my case-number is 6631`, or asked "What's your case-number?" | case_id | given | given | | `1. #help (C0HELP002) - public_channel` + a later `Message posted to: #help (C0HELP002)` / `Name: #help (C0HELP002)` | channel_id C0HELP002 | given | given | | `{"permalink":"https://…/archives/C0HELP002"}` | channel_id C0HELP002 | refused | given | | `Permalink: [link](https://…/archives/C0HELP002)` in a record | channel_id C0HELP002 | refused | given | | `Channel: Group DM (ID: C0GRP0001)` + Participants + From | channel_id C0GRP0001 | given | given | | `Channels: #help (C0HELP002)` / `Posted. channel_id: C0HELP002` | channel_id C0HELP002 | given | given | | `Channel owner: Ana Lind (U0ANA001)` / `Channel #onboarding guide: U0ANA001` | channel_id U0ANA001 | refused | refused | | link `…/search?q=C0HELP002` from a call sent `C0HELP002` | channel_id C0HELP002 | refused | refused | Two #1745 rows pinned the old refusal of a link a tool wrote: "the ID in a link a tool wrote" and "a link a tool wrote … even where it names the channel". AI-2822 asks for the opposite, so they moved to the new `TestAnIDInALinkAToolReturnedIsPassedOn` as given. Two more rules came in review, beside the four tickets. An ID before a kind word counts only when nothing stands between them (`U0… joined channel #help` is no channel; the real list shape `#name (C…)` still is one). The caller's own kind word is matched as a whole word, split at every mark: `showcase` is no `case`, `case#6631` and `ticket-4521` are. ## Changes - `ids.go`: `linked` (tool link parts, echoes excluded); the `other` check before written lines; `labelledName` became `labelledAs` (it returns each field's label); new `lineWords`, `holdsKind` and `labelNames`. - `ids_test.go`: 13 new rows in `TestAWrittenLineGivesOnlyTheIDBesideTheWordForItsKind` (35 in all), 1 in `TestALinkIsReadAsThePersonWroteIt` (8 in all), the new `TestAnIDInALinkAToolReturnedIsPassedOn` (8 rows), `TestALineLabellingAnIDAsAnotherKindOnlyDoubtsALabel` (7 rows), `TestAKindWordInsideAnotherWordIsNotTheCallerNamingTheID` (11 rows). CHANGELOG entry. ## Validation - `go test ./internal/agent -count=1`: ok (156.6s). `gofmt -l` and `go vet ./internal/agent`: clean. - A 110-row shape probe (the #1747 reviewer's shapes plus the shapes of these tickets) was run on base and on head. The only rows that differ are the ones in the table above. Every LIVE row (pasted permalinks, the channel list, the read_channel header, the Group DM search) is unchanged. - The new rows were run against base `ids.go`: each base-vs-head row in the table fails there; the control rows pass. - 38 mutations, all killed. The list groups them by rule; each has the test row that fails: - Tool links: echo check dropped, HTML unescape dropped, JSON decode dropped, parts not consulted. - Kind word: ID's own word allowed as kind, `#` name split at `_`, no `_` split, no plural, base substring form. - Labels and other kinds: label `Contains` vs suffix, `other` ignored, `other` negated, label is the whole field, no cut at ` - `, no cut at a bracket, label rule skipped. - AI-2821: R-h (unescape before decode), R-j (`id` by `Contains`). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
## Why The router's `served a request` line (`withRequestLog`, `acceleration/internal/api/server.go`) has none of the fields the Stream platform's `logs.access_logs` has. With it you cannot follow a trace from a line, group by endpoint, or see which client, auth type or user made a request. This PR adds those fields, named like the chat columns, so the ClickHouse view `logs.agent_access_logs` (chat INF-2474) can parse them. Linear: AI-3291. It builds on #2022, which added `app_id` and `api_key`. ## How it works ``` withTrace ─> ... ─> withCustomer ─> withRequestLog ─> withQuota ─> withServerSide ─> mux │ │ │ span on ctx routing.Caller after the handler: accessFields(routes, r, recorder) ├─ trace_id span ctx, if valid ├─ operation_type routeLabel, unless "unmatched" ├─ error_code recorder.refusal (noteRefusal) ├─ x_stream_client ┐ header, trimmed, ├─ stream_auth_type ├ cut to 256 bytes ├─ user_agent ┘ at a rune start ├─ request_size Content-Length > 0 ├─ user_id Caller.UserID, not server-side, cut to 256 └─ build_version Options.Release (main.release) ``` Every existing key keeps its name and place (`method path status duration customer request_id bytes error stack`; `app_id api_key` still come from the log handler). Each new key is left out when the request has none. A line from `LogAppSuite` (ids elided): ``` level=INFO msg="served a request" method=GET path=/v1/account status=404 duration=0s customer=… request_id=… bytes=258 operation_type=/v1/account error_code=billing_not_enabled stream_auth_type=server user_agent=Go-http-client/1.1 build_version=v0.0.0-logtest app_id=… api_key=… ``` | Choice | Why | | --- | --- | | `operation_type` is `routeLabel` (the metrics' route label), not the span name | It also finds the route of a request refused before the mux (withServerSide, withQuota). It is never the raw path, so a `{token}` route logs no secret | | `request_size` is `Content-Length` only | A chunked body (-1) logs none, and so does an empty one. Counting read bytes would miss a body the handler did not read | | `user_id` only for a caller that is not server-side | A backend may name the user it acts for (`auth.UserHeader`). Its request is still its own, and the brief asks to leave it out | | 256-byte cap on caller-chosen values | net/http admits 1 MiB of headers (`http.DefaultMaxHeaderBytes`). Reuses `trimmedTo` (actor.go), which cuts at a rune start | ## Validation `go test -tags integration ./internal/api/ -run 'TestLogAppSuite|TestLogAppProxiedSuite|TestLogHandlerSuite'`, `go vet ./...`, `go test ./cmd/router/`. | Change | Test (logapp_test.go) | | --- | --- | | trace_id from the span, none without one | `TestTheAccessLineNamesTheTraceOfTheRequestsSpan`, `TestTheAccessLineOfARequestWithNoSpanNamesNoTrace` | | operation_type is the pattern, also before the route, none if unmatched | `TestTheAccessLineNamesTheRouteItServedRatherThanThePath`, `…RefusedBeforeItsRouteNamesTheRoute`, `…APathNoRouteServesNamesNoOperation` | | error_code is the code the caller got, none on success | `TestTheAccessLineOfARefusalNamesTheCodeTheCallerWasTold`, `…ASuccessNamesNoErrorCode` | | headers named, absent omitted, long cut at a rune start | `…NamesTheClientItsAuthTypeAndItsUserAgent`, `…WithoutThoseHeadersNamesNone`, `TestAHeaderTheCallerChoseIsCutOnTheAccessLine` | | request_size, none for chunked or no body | `…NamesTheSizeOfTheBodyItWasSent`, `…ABodyOfUnknownLengthOrNoneNamesNoSize` | | user_id for end users (direct and proxied), not for a backend | `…AnEndUserNamesTheUser`, `…ABackendNamesNoUserEvenActingForOne`, `TestAUserIDTheCallerChoseIsCutOnTheAccessLine`, `LogAppProxiedSuite/…NamesTheUserTheProxySaidTheCallerIs` | | build_version from Options.Release, none when empty | `…NamesTheReleaseTheRouterWasBuiltFrom`, `LogAppProxiedSuite/…ARouterWithNoReleaseNamesNone` | Mutation check: 22 mutants of `accessFields`, the cap and the `Options.Release` wiring, all killed by the tests above (each guard flipped or dropped, the header names swapped, the route read from the path or from chi only, the cap set to 257, the `Content-Length` guard set to `!= 0` and `>= 0`). One equivalent mutant: dropping `ok` in the `user_id` guard, since a missing `routing.Caller` is the zero one, whose `UserID` is empty. Unverified: that staging and prod set an OTLP endpoint. Without one, tracing is off and `trace_id` is left out (`internal/tracing/tracing.go:43`). The `Release: release` line in `cmd/router/main.go` has no test: the options are built inside `run`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Why
A `key_refused` alert in Sentry reads `usage alert: key_refused
GOOGLE_API_KEY/402`. The reader must know that `402` means the account
is out of funds. Example: a provider key with no prepaid credit left
raised this alert, and someone had to explain in chat what `402` meant.
## How it works
```
keypool.Alerts ── Condition{Items, Describe} ──> alerts.Loop.checkItems
│ item = "<key_var>/<status>"
│ Describe(item) -> reason
v
send(..., item, description)
Message: usage alert: key_refused K/402: out of funds, top up the account
Fingerprint: usage_key_refused:K/402 (unchanged)
Tags: item=K/402, usage_alert=key_refused (unchanged)
```
| Status | Reason in the title |
| --- | --- |
| `402` (HTTP or socket frame) | out of funds, top up the account |
| `400`, `403`, `invalid_key` | key not valid, replace it |
| `401` | key not valid or its quota spent, replace it or top it up |
| `429` | rate limited or spend cap reached, wait, add keys or raise the
cap |
| `quota_exceeded` | quota spent, wait for it to reset or raise it |
| any other | no reason, title as before |
## Changes
- `alerts.Condition` gets an optional `Describe func(item string)
string`. Only the Sentry message uses it.
- `keypool` owns the status set, so the reason table (`refusalReasons`)
lives in `internal/keypool/metrics.go` and `Alerts` sets `Describe`.
- Production caller: `keypool.Alerts` in the metering alert loop,
`cmd/router/metering.go:27`.
## Validation
| Change | Test that proves it |
| --- | --- |
| Each counted status gets its reason, through the real pool paths and
the alert loop | `TestEveryRefusalStatusAlertsWithItsReason` (10 cases:
400, 401, 401 spent quota, 402, 403, 429, 429 spend cap, quota frame,
invalid key frame, out-of-funds frame) |
| An unknown status keeps its title |
`TestAStatusWithNoReasonKeepsItsTitle` |
| Fingerprint and `item` tag unchanged | the two tests above, and
`TestAnItemIsDescribedInTheMessageAndNowhereElse` |
| Conditions without `Describe` keep their messages |
`TestWithoutADescriptionTheMessagesAreAsTheyWere` |
`go test ./internal/keypool/ ./internal/alerts/` passes, `go vet` clean.
The message tests pin the strings the base code builds (`alerts.go`
`send` on the base). Not run: the full integration suite (CI). A real
refusal was not provoked on any environment.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings main's 9 commits into accelerate so the accelerate -> main PR merges clean. Conflicts resolved: - CLAUDE.md, agents-core/.../utils/text.py, tests/test_utils.py: kept deleted; accelerate moved agents-core to sdks/python and already has mask_phone_number. - ci.yml, daily.yml, run_tests.yml, release-sdk-js.yml: accelerate's version, which already carries main's secrets changes (#2018, #2020). - sdks/go: accelerate's version; main's Go SDK is a subset of it. - release.yml: accelerate's version plus main's build constraints and pinned hatch. - .gitattributes: both sides. - CHANGELOG.md: dropped main's #1957 entry, already present on accelerate.
> **Merge with "Create a merge commit", not squash.** A squash drops `main` as a parent, and #2030 conflicts again. ## Why #2030 (accelerate -> main) conflicts with main in 12 files. Main has 9 commits that accelerate lacks (Go SDK v0.1.0-v0.3.0, CI secrets changes, log masking). This PR merges them into accelerate once, so #2030 merges clean. ## How it works ``` main ───●──●── ... ──● f12ca79 (9 commits) \ \ \ ▼ accelerate ●── ... ──● 4b4bcba ──● 12d37c4 merge, this PR │ └─> #2030 into main: no conflicts ``` | Conflict | Resolution | Why | | --- | --- | --- | | `CLAUDE.md`, `agents-core/.../utils/text.py`, `tests/test_utils.py` | kept deleted | accelerate moved `agents-core` to `sdks/python` and already has `mask_phone_number` (`sdks/python/vision_agents/core/utils/text.py`); `AGENTS.md` carries main's Go release note | | `ci.yml`, `daily.yml`, `run_tests.yml` | accelerate's | accelerate already has #2018 and #2020 (no secrets in the unit run, the `integration` environment) | | `release-sdk-js.yml` | accelerate's | keeps the `registry-publish` environment, which main lacks | | `sdks/go/{acceleration/generated.go, agents/folder.go, stream/conversation.go}` | accelerate's | main's Go SDK is a strict subset: `git diff origin/accelerate origin/main -- sdks/go` adds no line | | `release.yml` | accelerate's + main's | adds main's `release-build-constraints.txt` and pinned `hatch` | | `.gitattributes` | both sides | | | `CHANGELOG.md` | dropped main's #1957 entry | `merge=union` copied it into an old section; accelerate already has it | Result against `accelerate`: 5 files, +172/-2, all CI and release config (`.gitattributes`, `release.yml`, and main's new `release-build-constraints.txt`, `release-sdk-go.yml`, `sdk-go.yml`). No Python or Go code changes. `sdk-go.yml` duplicates the `go-sdk` job in `ci.yml`, and its comment calls `sdks/go` on main a copy of accelerate's, which stops being true after #2030. Left as main has it; a follow-up can remove it. ## Validation - No conflict markers left; `git merge-tree` of the result with `origin/main` reports no conflicts. - `dev.py check` not run: no `.py` or `pyproject.toml` differs from `accelerate`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Tommaso Barbugli <tbarbugli@gmail.com> Co-authored-by: Boris Bokan <bokan.boris@gmail.com> Co-authored-by: Neevash Ramdial (Nash) <mail@neevash.dev> Co-authored-by: Kanat <kijalbaev@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Laurent Schaffner <laurent.schaffner.code@gmail.com> Co-authored-by: Laurent Schaffner <laurentschaffner@Laurents-MacBook-Pro-Stream.local>
The scheduled run checked out accelerate in the default branch's cache scope, which CodeQL reports as cache poisoning, and would fail once accelerate is merged and deleted. Drop the ref input from run_tests.yml.
## Why
A call's transcript is read back from the chat channel it was written
to. The reader counted every line marked `source: agent` as the agent's,
whoever wrote it (`chatlog/reader.go:137` at the base). People other
than the agent write in those channels: a shared conversation's members,
readers `/v1/agents/chat-token` adds to `agent:<agent_id>`. Example:
Ben, a member of a shared conversation, posts "The agent approved Ben's
shift swap." with `source: agent` during a call. `GET
/v1/agents/calls/{id}/transcript`, the call's timeline and a campaign's
outcome then read it as the agent speaking. Found in review of #2008
(AI-3186 R1.1); AI-3265.
While testing, a second case showed up: the conversation service marks
every line it writes `source: agent`, a person's typed turn too, written
as that person (`conversation.go:2330`, `:2350`). So the transcript also
read a caller's typed question as the agent's.
## How it works
The agent writes in a call's channel as two users: its spoken lines as
the session's `UserID` (`cmd/router/sessions.go:75`), and its typed
replies as the agent id (`sendWith`, `conversation.go:2307`;
`spec.AgentID = conv.Agent()`, `session/manager.go:595`). The call row
now keeps the first; the second is already there (`calls.agent_id`).
```
a line in the call's channel
├─ source: agent
│ ├─ call row has no agent_user_id (call from before) -> agent's (as before)
│ ├─ written as agent_user_id or as agent_id -> agent's
│ └─ written as anybody else -> that person's
├─ no source, written as agent_id -> agent's (unchanged)
└─ anything else -> that person's (unchanged)
```
```
session.row() ── spec.UserID ──> calls.agent_user_id (new, nullable)
│
api.transcriptReads ── chatlog.Read{Agent, Writer} ──> chatlog.Reader
│
┌───────────────────────────────┼─────────────────────────────┐
GET .../transcript GET .../timeline campaign.classify
(calls.go:444) (calls.go:686) (Server.CallTranscript)
```
## Changes
- Migration `20261231090000_calls_agent_user_id.sql`: `ALTER TABLE calls
ADD COLUMN IF NOT EXISTS agent_user_id TEXT`, no default, `lock_timeout`
5 s, as `20261211100000_calls_conversation_id.sql` does. Expand-only.
- `store.Call.AgentUserID`; `StartCall` keeps the first one it was given
(`COALESCE`, as `conversation_id`).
- `session.row()` fills it from `spec.UserID`; `api.transcriptReads`
passes it as `chatlog.Read.Writer`.
- `chatlog.Reader`: a marked line is the agent's only when written as
`Writer` or `Agent`; empty `Writer` keeps the old rule.
| Reader | Ben's marked line, before | after | A caller's typed turn,
before | after |
|---|---|---|---|---|
| transcript `agent` flag | true | false | true | false |
| timeline `said` / `heard` | in `said` | in `heard` | n/a | n/a |
| `CallTranscript` (campaign `callerSpoke`) | agent | Ben | agent |
caller |
| any reader, call row from before the column | agent | agent
(unchanged) | agent | agent (unchanged) |
## Validation
| Test | Defect it catches | On base 4b4bcba |
|---|---|---|
|
`CallsSuite/TestAMembersLineMarkedAsTheAgentsIsTheMembersOnEveryReader`
| Ben's marked line read as the agent's on the transcript, the timeline
or `CallTranscript` (the campaign dialer's input) | fails (all three) |
|
`CallsSuite/TestACallFromBeforeItsWriterWasKeptReadsAMarkedLineAsTheAgents`
(control) | an old call row reading differently; expected values from a
base run | passes |
|
`SessionCreateSuite/TestAMembersLineInASessionsConversationMarkedAsTheAgentsIsTheirs`
(end to end: a real session, its call row, its conversation) | the
session not storing its writer; the agent's own reply no longer the
agent's; Ben's line or the caller's question read as the agent's | fails
|
|
`ChatLogSuite/TestAMembersLineMarkedAsTheAgentsIsTheMembersOnceTheWriterIsKnown`
| the rule with and without a writer: spoken line, typed reply,
marked/unmarked agent-id lines, a member's and a person's marked lines |
fails (known writer); the no-writer half passes |
| `StoreSuite/TestACallStartedAgainLearnsWhoTheAgentWroteAsAndKeepsIt` |
a restarted call overwriting or never learning the writer | n/a (new
column) |
The base runs used the PR's test files with the new fields removed.
Every guard in the diff was mutated (9 mutants: each part of the
reader's condition, `Writer` not passed, `row()` not filling it, the
upsert overwriting or dropping it); each was killed by a test above.
Passing locally on the PR merged onto `origin/accelerate`:
`./internal/chatlog/ ./internal/session/ ./internal/campaign/
./internal/store/ ./internal/api/` (unit), and with `-tags integration`
`./internal/chatlog/`, `StoreSuite`, `CallsSuite`, `SessionCreateSuite`.
The full integration run is CI's.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Nash0x7E2
approved these changes
Nov 16, 2026
…hedding load (#1907) **In short.** - **What changes for callers.** The router's chorus-asr client keeps working with two or more server replicas behind one address, and backs off when the server sheds load. - **Before:** each 404 for an unknown agent made the router forget every agent and register them all again. It also counted the 404 toward a floor that rules alone stepping aside. - **Now:** only the agent that missed is registered again, and a miss counts neither way toward a floor stepping aside. - **Under overload:** while the server's `Retry-After` lasts, the pause checks, which decide turns, still go out. Checks over the agent are held back for at most 2 s, and interims for up to 30 s. - **What changes for operators.** - New metrics: errors by status, the latency of `/v1/agents` and `/v1/info`, and the requests held back. - Info logs when a back-off begins and ends. - `transcribe_failures_total{reason="connection"}` now means that nothing answered. - The chorus-asr client has its own transport: 50 s idle timeout, under the server's. - **Server side:** GetStream/gophonic draft PRs #130 (inline agents), #131 (admission, `Retry-After`, `X-Timeout-Ms`), #132 (`/metrics`, `/readyz`) and #133 (shutdown, 120 s idle timeout). The gophonic agent was sent this PR's wire contract: - `inline_agents` as a boolean in `/v1/info`; - the `agent` part last; - 404, not 400, on a mismatch; - `X-Timeout-Ms`; - `Retry-After` in seconds. #130 and #131 match it (see [Wire formats](#wire-formats)). - From the infra review in GetStream/chat#20500 (`infra/docs/chorus_asr_readiness.md`, gaps 2, 3 and 10, and the router asks 1-4). The second commit fixes what the review of the first one found (S1-S5). ### What changes **Several replicas** (`audiofloor.go`, `decide`/`register`): - **A 404 on `/v1/decide`** has the router register that agent again, and only that one, then retry once. - Every other cached ID stands: an agent's ID is a hash of its content, so it is the same on every replica. - The background policy re-read on a 404 is kept, as before. - **A second 404** after registering again returns `ErrAgentUnknown`. That error is neither `Unreachable` nor `Misconfigured`. - A pause check falls to the words alone, and a Hearer check to the flow controller. - For a floor that rules alone it counts **neither way** (`floor.go` `checked`, S5). It neither adds to the run of unanswered checks nor resets it, so a server that is down between misses is still given up. - **A 404 on `/v1/agents` or `/v1/transcribe`** still counts as unreachable, as a proxy with nothing behind it answers. - **A refused agent (422) stands refused for 5 minutes, then is offered again** (S1, `refusalTTL`). - Before, a 404 for any agent cleared every cached entry, refusals included. - Now that a 404 tells only the agent that missed again, a refusal would otherwise stand until the router restarted, even if the server had restarted on a model that takes the agent. - **Inline agents.** A server whose `GET /v1/info` says `"inline_agents": true` is sent the agent with each decision ([wire formats](#wire-formats)), so any replica can answer for any agent. - Only an agent of up to 32 KiB of that JSON goes with every decision (S4, `maxInlineAgent`). A larger one goes inline only with the decision asked again after a 404, alongside the re-registration, so it costs one miss per replica rather than its size on every decision. - A server that doesn't say so is sent what it is sent today. **Overload** (`Retry-After`): - **When it applies:** any 503 or 429 that carries `Retry-After`, on any route. The header can be seconds or an HTTP date. - **Held back while it lasts:** - **Checks over the agent, for at most 2 s** (S2, `maxOverAgentBackOff`). These come from the transcriber's `checkOver` and from the flow controller's Hearer. The client returns `ErrBackingOff` without sending a request, so the flow controller rules on those turns. - On a deployment whose flow controller fails, that means missed stops. That is the reason for the short cap: no longer than a shedding server asks. gophonic's `-retry-after` defaults to 1 s. - **Interims, for up to 30 s** (`interims.go`). - **Still sent:** pause checks (including pauses while the agent is talking), still checks, probes, a pause's words, and each utterance's final. - **How a held-back check counts:** neither way toward a floor stepping aside. - **Logged at info:** once when a run of `Retry-After` begins (status, `retry_after`, how long each kind is held), and once when it is over, by the first request to find it over. - **Counted in:** `router_chorus_asr_backed_off_total{kind="over_agent"|"interim"}` and `checks_total{outcome="backed_off"}`. - **Not a back-off:** - A 503 without `Retry-After`, as today's server sends. - A 503 read once the router's own deadline has passed. The server answers 503 (with `Retry-After`) to a request whose `X-Timeout-Ms` ran out before a lane was free. That says the router gave the request up, not that the server is shedding load. Like any 503 it is busy, not unreachable. **Deadline header.** Every decision and transcription sends `X-Timeout-Ms`, so that the server can drop work the router has given up on ([wire formats](#wire-formats), S3). The value is rounded up, so the server never gives a request up before the router does. **Metrics** (`roundtrip.go`): - `router_chorus_asr_request_errors_total{kind, code}` - `kind`: `over_agent`, `pause`, `transcribe`, `agents` or `info`. - `code`: the HTTP status (`404`, `429`, `503`...), or `busy`, `no_words`, `timeout` or `connection`. - A decision answered 404 is counted for each attempt. Requests canceled by newer words are not counted. - `router_chorus_asr_setup_round_trip_seconds{route="agents"|"info", outcome}`. - `router_chorus_asr_backed_off_total{kind}`. **Connections:** - **`reason="connection"` while the logs showed only busy answers.** I confirmed the cause in code: a labelling bug. - `failure()` labelled `connection` every error that wasn't a `StatusError` or a deadline. That included a decision's words answered `{"transcript_error":"busy"}`. - That answer comes from the pause's first check (`pauses.go` `await`). It is logged as `the words: busy`, the line the review saw on 11-07, and was counted as a connection. - It is now `busy`, and other answers without words are `no_words`. - **Stale kept-alive connections** are a separate, plausible cause, but staging doesn't show they happened. - The client ran over `http.DefaultClient`: 90 s idle timeout against the server's 60 s at `02af4b0`. - net/http resends a POST on a connection the server closed only when the request is marked idempotent. - The client now has its own transport: 256 idle connections per host, as the router's default transport keeps, each closed after 50 s unused. That is under 60 s at `02af4b0` and under 120 s from gophonic #133. - Every request is marked idempotent with an `Idempotency-Key` that net/http never puts on the wire (a nil header value; a test checks it isn't sent). A request that goes out on a connection the server is closing is then sent again on a new one. All of them are safe to resend: info, registration by content hash, a decision, transcription. - **The 50 s timeout is defensive.** A test reproduces the resend; nothing shows it happened on staging. ### Wire formats What the router sends, and what gophonic #130 and #131 do with it: | | Router | Server (gophonic #130, #131) | | --- | --- | --- | | Inline agents in `GET /v1/info` | reads a top-level boolean `"inline_agents": true` | #130 adds it. | | The agent with a decision | `POST /v1/decide?agent=ID`, `multipart/form-data`: `turn`, then `audio`, then `agent` (`application/json`, the same bytes `POST /v1/agents` takes: `{"instructions","tools","languages"}`). `?agent=ID` is the ID registration answered. Sent with every decision for an agent of up to 32 KiB, and with the decision asked again after a 404 for a larger one. | #130: a known `ID` skips the part. An unknown `ID` whose part compiles to `ID` is registered from it (not warmed) and decided in the same request. Otherwise it gets a 404 that names the ID the part compiles to. Other parts after the audio are ignored. An unknown agent's 404 now comes after the server has read the turn and the audio; a body that isn't multipart still gets its 404 at once. | | Deadline | `X-Timeout-Ms: <whole ms ≥ 1, rounded up>`: what is left of the router's deadline when it sent the request. On a transcription, that is the request's deadline. On a decision, it is **the decision's own deadline, also with `?transcript=true`**: it bounds line 1, and the router waits for the words on a clock of its own (8 s plus the audio's length), which the header does not carry. Not sent without a deadline. | #131: the same meaning, under the same name. It waits for a lane no longer than that, and gets a 503 if none was free in time. 0 or less gets a 503 at once (the router never sends that), and a non-integer gets a 400. On `/v1/decide` it bounds line 1 only. | | Back-off | reads `Retry-After` on 503 and 429: seconds or an HTTP date. Holds checks over the agent back for up to 2 s, and interims for up to 30 s. | #131: `Retry-After` on every 503, a fixed whole number of seconds (`-retry-after`, default 1). | **Why the `agent` part goes last.** The server at `02af4b0` (`turnAndAudio`) reads `turn`, then `audio`, then stops. - A trailing part is ignored; a leading part would get a 400. #130 checked this: on `02af4b0`, a known agent's decision with a trailing `agent` part is answered 200. - So during a rollout, info can come from a new replica and the decision land on an old one, and the fleet keeps answering. The old replica may 404, and the router then registers again as before. ### Compatibility - **Today's server (gophonic `02af4b0`), one replica:** behaves as before, except that a 404 re-registers one agent rather than all of them, and a refusal is offered again after 5 minutes. - No `inline_agents`, so no `agent` part is sent. - `X-Timeout-Ms` is ignored. - No `Retry-After` is sent, so nothing is held back. - **Today's server, two or more replicas:** no more re-registration storms, and misses don't move floors that rule alone either way. - Misses still happen: the registration can land on replica A and the retry on B. That second miss falls to the flow controller or the words alone. - It converges as each replica learns each agent: each miss teaches the replica it reaches. Only inline agents make N ≥ 2 free of misses. - **gophonic #130-#133:** - No misses on any replica (one per replica for agents over 32 KiB). - `Retry-After` is honoured within the caps. - The server drops work past `X-Timeout-Ms`. - Its 120 s idle timeout sits above the client's 50 s. - **Mixed fleet during a rollout:** safe, as explained above. - **Not touched:** `pauses.go` and `internal/agent`, so #1886 doesn't conflict (`git merge-tree` is clean). ### For operators - **The back-off covers the whole router pod.** One client serves every call on a router pod, and it sees only the Service. - So one replica's 503 with `Retry-After` holds back checks over the agent (for at most 2 s) and interims (for up to 30 s) for every call on that pod, whichever replica would have answered. - Meanwhile the flow controller rules on speech over the agent, and no interims are shown. - Pause checks, and with them turn ends, are unaffected. - The router logs at info when a back-off begins and when it is over. - New metric names reach Datadog only once the accelerate chart's allowlist (#20508 in GetStream/chat) includes them: - `router_chorus_asr_request_errors_total` - `router_chorus_asr_setup_round_trip_seconds` - `router_chorus_asr_backed_off_total` - Changed label values: - `transcribe_failures_total{reason}` gains `busy` and `no_words`. Its `connection` series drops by what was really busy answers. A monitor on `connection` should read that drop as relabelling, not as a recovery. - `checks_total{outcome}` gains `backed_off`. - #20508's runbook line "Unanswered means … a 404" no longer holds for `/v1/decide`. - `acceleration/deploy/chorus-asr/README.md` documents the protocol additions, the replica behaviour, refusals, back-off, connections and the metrics. ### Tests New, in `internal/audiofloor/serving_test.go`, using a two-replica fake. Each replica knows only the agents it was told, by a content hash. The test routes every registration and decision to a chosen replica; the policy's background re-read goes outside the schedule, so it can't race it. I took each change out in turn, and its tests failed. All 25 such checks were re-run on the final code: | Change taken out | Tests that fail | | --- | --- | | Only the agent that missed is told again (back to clearing every ID) | `TestAReplicaThatMissesAnAgentHasThatAgentAloneToldAgain` | | A second 404 is `ErrAgentUnknown` (bare 404 returned), or `Unreachable` ignoring it | `TestAnAgentMissedWhereverItWasToldIsNoServerDown`, `FloorSuite/TestAFloorWhoseChecksMissTheAgentOnAReplicaDoesNotStepAside` | | S5: `ErrAgentUnknown` counts neither way in `checked` | `FloorSuite/TestAFloorCountsNoCheckAReplicaMissedTheAgentOn` | | S1: a refusal expires after `refusalTTL` | `ClientSuite/TestARefusedAgentIsOfferedAgainOnceItsRefusalIsOld` | | The inline `agent` part | `TestAServerThatTakesAgentsInlineIsToldTheAgentWithEachDecision` | | S4: a large agent goes without the part at first, and with it on the decision asked again | `TestALargeAgentGoesInlineOnlyAfterAMiss` (each half on its own) | | Checks over the agent held back | `ClientSuite/TestARetryAfterHoldsTheChecksOverTheAgentButNotThePauses`, `PausesSuite/TestARetryAfterHoldsTheInterimsAndTheChecksOverTheAgentButNotThePauses`, `FloorSuite/TestAFloorCountsNoCheckHeldBackWhileTheServerAsksForTime` | | S2: the 2 s cap over the agent | `ClientSuite/TestAChecksOverTheAgentAreHeldBackBrieflyAndInterimsLonger`, `TestARetryAfterIsSecondsOrADateAndBounded` | | S2: the log when a back-off begins, and the log when it ends (each on its own) | `ClientSuite/TestAChecksOverTheAgentAreHeldBackBriefly…` | | Interims held back | `PausesSuite/TestARetryAfterHolds…` | | `Retry-After` read on 503/429 | `ClientSuite/TestARetryAfterHolds…`, `PausesSuite/TestARetryAfterHolds…` | | A 503 read past the router's deadline starts no back-off | `TestABusyAnswerReadPastTheDeadlineHoldsNothingBack` | | The 30 s cap for interims | `TestARetryAfterIsSecondsOrADateAndBounded` | | A held-back check counts neither way in `checked` | `FloorSuite/TestAFloorCountsNoCheckHeldBack…` | | The `backed_off` check outcome | `ClientSuite/TestARetryAfterHolds…` | | `X-Timeout-Ms` sent | `ClientSuite/TestARequestSaysHowLongItIsWaitedFor` | | S3: `X-Timeout-Ms` is the decision's deadline with `?transcript=true` (sending the request's instead) | `ClientSuite/TestARequestSaysHowLongItIsWaitedFor` | | Errors by status, and timing of `/v1/agents` and `/v1/info` (each on its own) | `ClientSuite/TestFailuresAreCountedByStatusAndTheSetUpIsTimed` | | The 50 s idle timeout | `TestTheClientClosesAnIdleConnectionBeforeTheServerDoes` | | The `Idempotency-Key` marker (the test's server closes a kept-alive connection as the next request arrives on it) | `TestARequestOnAConnectionTheServerClosedIsSentAgain` | | The marker never on the wire (an empty value sent instead of nil) | `TestAServerThatTakesAgentsInlineIsToldTheAgentWithEachDecision` | | Busy words counted `busy` | `PausesSuite/TestAPausesWordsAnsweredBusyAreBusyNotAConnection`, `TestAFailureIsWhatTheServerAnswered` | `ClientSuite/TestARetryAfterHolds…` also checks that `Transcribe` is still sent during a back-off. Every existing test passes. The fake gained four fields (`unknown`, `retryAfter`, `wordsBusy`, `deadlines`), and the two test callers of `decisionBody` pass `nil` for the new argument. The fake's strict part check (`turn`, `audio` and nothing else) confirms that a server that doesn't advertise inline agents is sent no `agent` part. Runs: - `go test ./internal/audiofloor/` passes, plain and with `-race`. - The agent's floor tests pass: `go test ./internal/agent/ -run 'TestAgentSuite/(TestActingWithAnotherTranscriber|TestWithoutChorusASR|TestAnAnswerTalkedOverWhilePlayingIsToldAgain|TestACheckInTheCallerTalksOverIsStopped|TestSomebodyLeaving|TestAReplyThatEndsWithinItsShortenedTailIsNotCut|TestAShortenedCheckInStopsAtOnce|TestAShortenedReplyGivesWayUntilTheNextTurn|TestAShortenedReplyStopsWithinItsTail|TestTheContractIsKeptWhicheverTranscriberHearsTheCaller)'`, and `go test ./cmd/agent/ -run 'TestTheAudioFloor|TestTheAgentsFloorControl'`. - CI runs the rest. **Not verified:** - Nothing here ran against a real chorus-asr server, or against gophonic #130-#133 built together, or with real replicas. - The wire match with #130 and #131 is read from their PR text and diffs. ### Release guards Release guards: pending (the real-voice gate). Do not merge before it is in. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
thesyncim
temporarily deployed
to
integration
November 16, 2026 16:11 — with
GitHub Actions
Inactive
thesyncim
temporarily deployed
to
integration
November 16, 2026 16:11 — with
GitHub Actions
Inactive
This was referenced Nov 16, 2026
kanat
added a commit
that referenced
this pull request
Nov 16, 2026
`accelerate` was merged into `main` by #2030, so instructions that tell an agent to use it now name `main`. Docs-only, no code. | File:line | Old | New | | --- | --- | --- | | `AGENTS.md:5` | work happens on `accelerate` | `main` | | `.claude/skills/pr/SKILL.md:22` | commit subject on `accelerate`/`main` | `main` | | `.claude/skills/add-connector/SKILL.md:84` | PR on the `accelerate` branch | `main` | | `.claude/skills/parallel-agents/SKILL.md:60,69,88,93` | `origin/accelerate` | `origin/main` | | `.claude/skills/parallel-agents/SKILL.md:78` | check not required on `accelerate` | `main` (the `main` rulesets have no required status checks) | | `.claude/skills/provider_audit/SKILL.md:71` | `git grep ... origin/accelerate` | `origin/main` | | `.claude/skills/docs/SKILL.md:40` | source on `accelerate` | `main` | | `.claude/skills/deploy/SKILL.md:104,108` | GetStream/chat on branch `thierry/accelerate-gke`, not master; "same branch" | `master`; "same repo" (`thierry/accelerate-gke` merged in chat #16465; the staging file is on master) | Found by grepping `AGENTS.md`, `CLAUDE.md`, `.claude/` and `.agents/` for the branch name (not the `acceleration/` dir, `accelerate-*` names or tags): | File:line | Old | New | | --- | --- | --- | | `.claude/skills/accelerate-sales-engineer/SKILL.md:55` | links `tree/accelerate`, `blob/accelerate` | `tree/main`, `blob/main` | | `.claude/skills/good_morning/SKILL.md:13` | Vision-Agents branch `accelerate` | `main` | | `.claude/skills/loop_performance_bench/SKILL.md:28` | branch off `accelerate` | `main` | | `.claude/skills/cli/SKILL.md:35` | deployed less often than `accelerate` moves | `main` | Left on `accelerate`: `sdk-dotnet/SKILL.md:41` — the release workflows still gate on `refs/heads/accelerate` (`release-sdk-dotnet.yml:32`, `release-sdk-js.yml:19`, and `publish-sdk-kotlin.yml:66` by branch name); tracked in AI-3309. Kept: `parallel-agents/SKILL.md:8` and `provider_audit/vendors.md:4` (history). Not changed: `.claude/skills/sdk-go/SKILL.md:44,103,108-149` and `sdks/go/README.md` links. The Go release flow copies `sdks/go` from `accelerate` onto `main`; with one branch that flow needs a decision, not a rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
kanat
added a commit
that referenced
this pull request
Nov 17, 2026
…when a session is reopened) (#2046) Ports [#2037](#2037) (AI-3201) to `main`. #2037 merged into `accelerate` after `accelerate` was merged into `main` (#2030). Staging runs `accelerate-v0.6.354`, which was built from `accelerate`. Without this port, the next staging deploy from `main` drops #2037. ``` accelerate ──●── #2037 ──► v0.6.354 (staging now) main ──●── #2036, #2039, … (15 commits) ← this PR adds #2037 ``` | Check | Result | | --- | --- | | `git cherry-pick -x b2334ad` on `origin/main` | clean, no conflicts | | `go build ./...`, `go vet` on touched packages | ok | | `go run ./cmd/openapi` | no diff | | `npm run types -- --check` (sdks/js) | in step with the spec | | `go test ./internal/session/ ./internal/conversation/` | ok | | Migration `20270101090000` | newest on `main` (`20261231090000` before it); already applied on staging by v0.6.354 | The code is #2037 unchanged; it was reviewed and merged there. ### Merge with `main` (df06a47) `main` gained [#2044](#2044) (session tools), which touches the same code: | File | Resolution | | --- | --- | | `api/sessions.go` | `declaredTools` now maps `toolOf`, #2044's helper for one tool | | `session/records.go`, `records_test.go` | the recorder keeps both `ToolTimeout` and `Offered` | | `session/tools.go` | git merged it with no conflict, but `bridge.Run` unlocked twice and panicked; kept `main`'s single unlock (#2044 holds the lock over both reads) | | `sdks/swift/core/generated.json` | regenerated at its pinned generator commit; `--check` passes | `go test -race` for session and conversation passes, and so do the `integration` suites for `internal/api`, `internal/session/...` and `internal/store`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SWVEMob5wtaNHdUCC1msgG Co-authored-by: Laurent Schaffner <laurent.schaffner.code@gmail.com> Co-authored-by: Laurent Schaffner <laurentschaffner@Laurents-MacBook-Pro-Stream.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
kanat
added a commit
that referenced
this pull request
Nov 18, 2026
## Why `accelerate` was merged into `main` (#2030). The release workflows still ran only from `accelerate`, so a run from `main` skipped the release job. The Go SDK flow copied `sdks/go` from `accelerate` onto `main`, and there is nothing left to copy. Ticket: AI-3309. ``` before: accelerate --copy sdks/go--> main --tag sdks/go/vX.Y.Z after: main --tag sdks/go/vX.Y.Z ``` ## Changes | File | Before | After | |---|---|---| | `release-sdk-dotnet.yml:32` | `workflow_dispatch`, job `if` = `refs/heads/accelerate` | same trigger, `if` = `refs/heads/main`; the "a run from main does nothing" note is gone | | `release-sdk-js.yml:19` | `workflow_dispatch`, job `if` = `refs/heads/accelerate` | same trigger, `if` = `refs/heads/main` | | `sdks/js/release.config.mjs:13` | semantic-release `branches: ["accelerate"]` (would refuse to release from `main`) | `["main"]` | | `publish-sdk-kotlin.yml:18,23,66` | push on `accelerate` or `release-kotlin-*-SNAPSHOT`; PRs into `accelerate`; "not a release" check on `accelerate` | the same, with `main` | | `sdk-go.yml:3` | comment: `sdks/go` is a copy | comment only; triggers unchanged (push `main`, PRs) | | `.claude/skills/sdk-go/SKILL.md` | develop on `accelerate`, copy onto `main`, tag the merge commit | land on `main`, tag a `main` commit by SHA; no copy step, no "never edit on main" rule | | `sdk-dotnet` skill, Go, JS, Kotlin READMEs, `package.json`, `build.gradle.kts` | `accelerate` branch and `tree/accelerate`, `blob/accelerate` links | `main` | - `release-sdk-go.yml` is untouched: it already requires the tag to be an ancestor of `origin/main` (`:45`). - `sdks/go/go.mod` has no `replace`, so the module path `github.com/GetStream/Vision-Agents/sdks/go` needs no copy. `GOWORK=off go mod tidy -diff` and `go vet ./...` in `sdks/go` pass on this branch. - `registry-publish` has no deployment-branch policy (`gh api repos/GetStream/Vision-Agents/environments`: `deployment_branch_policy: null`), so `main` may enter it. - No release is cut, no tag is pushed, no workflow is run here. ## Validation - `actionlint` on the four changed workflows: one warning, SC2046 in `release-sdk-js.yml`, the same on the base commit. - Each workflow loads with a YAML parser; the `on:` triggers are as in the table. - Not run: a real release from `main` (.NET, JS, Kotlin, Go). Unverified until the first one. - Also dropped `accelerate` from the push triggers of `ci.yml`, `client-sdks.yml`, `integration.yml`, `python-versions.yml`, and from comments in `run_tests.yml`, `daily.yml`, `.cursor/install.sh`, `sdks/go/doc.go`. - `registry-publish` has no required reviewer (`protection_rules: []`): the only gate is the job `if` on `refs/heads/main`. The workflow comments say so. Adding a reviewer is a settings change, tracked separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.