Fix assistant history text block merging#4449
Merged
Merged
Conversation
Contributor
Contributor
Electric Agents Mobile BuildAndroid preview build for commit
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## horton/run-failure-details #4449 +/- ##
==============================================================
+ Coverage 56.22% 56.23% +0.01%
==============================================================
Files 266 266
Lines 28763 28762 -1
Branches 8054 8058 +4
==============================================================
+ Hits 16171 16174 +3
+ Misses 12577 12573 -4
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Needs a rebase on latest main |
…ock-merge # Conflicts: # packages/agents-runtime/src/pi-adapter.ts
icehaunter
approved these changes
Jun 1, 2026
msfstef
added a commit
that referenced
this pull request
Jun 3, 2026
… by TS CI These type errors were sitting on main, hidden while the TS suite was startup-failing. Reviving it (the ts_tests permission fix in this PR) exposes them: - pi-adapter: type the merged assistant `content` so the array spreads into prevContent typecheck (was unknown[], from #4449). - webhook-signature: node:crypto no longer exports JsonWebKey; cast the jwk input to JsonWebKeyInput instead. - sandbox/docker: re-export isDockerAvailable from the docker.ts file so the `sandbox/docker` subpath resolves it under the tsconfig path wildcard used by dependents (electric-ax, agents-server-ui, conformance-tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
msfstef
added a commit
that referenced
this pull request
Jun 3, 2026
…nfig (#4495) ## What Started as a fix for three CI failures observed on `main`; reviving the TS suite (the first fix) then surfaced pre-existing typecheck breakage that had been hidden while CI was dark, which this PR also cleans up. ### CI / build fixes | Job | Verdict | Fix | |-----|---------|-----| | **TS tests** | 🔴 Real — startup-failing on *every* run since #4450 | Job-scoped `packages: write` on the `ensure_sync_service_image` caller | | **Agents Desktop Canary** | 🔴 Real — fails every run since #4441 | `-c.channel` → `-c.publish.channel` | | **Changesets** | 🟡 Flake — intermittent `agents-runtime` dts race | Promote `skills/types` to a tsdown entry | ### Typecheck fixes (pre-existing breakage exposed by re-enabling TS CI) | File | Issue | Fix | |------|-------|-----| | `agents-runtime/src/pi-adapter.ts` | merged assistant `content` typed `unknown[]` (#4449) | annotate the block-array type | | `agents-runtime/src/webhook-signature.ts` | `node:crypto` no longer exports `JsonWebKey` | cast input to `JsonWebKeyInput` | | `agents-runtime/src/sandbox/docker.ts` | `isDockerAvailable` not on the subpath the tsconfig wildcard resolves | re-export it (cascade fix for `electric-ax` / conformance) | | `agents-server-ui/tsconfig.json` | UI typechecked agents-runtime's node-only sandbox source via `paths` | resolve the index via built `.d.ts`; keep only the browser-safe `client` source-mapped — UI stays node-free | ## Why (CI fixes) - **TS tests:** #4450 downgraded the workflow's top-level token to `packages: read`, but `ts_tests.yml` is the sole caller of the reusable `ensure_sync_service_image.yml`, whose job requests `packages: write` to push the sync-service image to GHCR. A called reusable workflow cannot elevate permissions above the caller's token, so GitHub failed the **entire run at startup** — meaning the TS test suite had not run on any commit (main or PR) since. Fixed by granting `packages: write` only on the caller job, keeping the top-level token at `read` per #4450's hardening. - **Agents Desktop Canary:** electron-builder 26.8.1 rejects the config with `unknown property 'channel'`. `channel` is not a valid root property — moved under the publish provider (`-c.publish.channel=beta`, alongside the existing `-c.publish.url`). - **Changesets:** `agents-runtime` dts build intermittently fails with `UNLOADABLE_DEPENDENCY: Could not load src/skills/types.d.ts` under CI's parallel build. Promoting `src/skills/types.ts` to a first-class tsdown entry makes its `.d.ts` a stable named output instead of a raced chunk. ## Validation - Workflow files parse as valid YAML. - All previously-failing typecheck packages (`agents-runtime`, `electric-ax`, `agents-server-ui`, `agents-server-conformance-tests`) verified green via CI-faithful isolated (`--frozen-lockfile`) install + build + typecheck. ## Not in scope (pre-existing, flagged separately) - `runtime-dsl.test.ts` (92 tests, `401 UNAUTHORIZED: Principal is not allowed to spawn`) — from #4475's permission enforcement (@icehaunter); test fixtures need spawn permission seeded. Not a build/type issue. - An `agents-mcp` dts-race flake in the conformance build (same class as the `skills/types` one). ## Note for reviewer The canary maps channel input `canary` → publish channel `beta`. Preserved the existing value, but flagging in case it should be `canary`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Testing
This avoids OpenAI Responses duplicate fallback item ids like
msg_153when replayed assistant history contains multiple unsigned text blocks in a single assistant message.