GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — chore: upgrade Effect to 4.0.1 by kitlangton · Pull Request #54198 · anomalyco/opencode Conversation
|
| Surface | Change |
|---|---|
Effect client (@opencode/client/effect) |
Types identical. Inline string & Brand.Brand<"Workspace.ID"> becomes Workspace.ID |
| OpenAPI | 22 branded schemas become named #/components/schemas/<Name> entries referenced with $ref. Request and response bodies are unchanged |
| Promise client types | 26 new type aliases such as export type SessionID = string referenced by existing types. All 649 existing exports remain mutually assignable with origin/v2 |
| Validation errors | A value of the wrong kind reports Expected Session.ID instead of Expected string. Messages for malformed strings are unchanged |
| Tool schemas sent to models, Code Mode signatures, CLI config schema | Unchanged |
Promise types.ts order |
100 declarations move because SchemaRepresentation.toCodeDocument sorts types topologically after the new ID aliases they reference (plus Effect #8630) |
This upgrades V2 to Effect 4.0.1. Runtime validation, the generated client types, and location shutdown behave as before. The OpenAPI document names its branded IDs, which is visible to tools that generate code from it.
Run on Linux x64 with Bun 1.4.2, comparing this branch with origin/v2:
bun run check bun run lint:changed origin/v2 (cd packages/protocol && bun run generate) (cd packages/client && bun run generate) (cd services/www && bun run generate) (cd packages/cli && bun script/schema.ts ../../services/www/public/cli.json --check) (cd packages/<each package below> && bun run test) # bun test in schema and protocol
origin/v2 (433/433).Money.USD to number, fails typecheck with __generatedOutputWiderThanContract.packages/core/test/browser-idle.test.ts.| Suite | This branch | origin/v2 |
|---|---|---|
| core | 6,602 pass, 33 skip | 6,605 pass, 33 skip (3 tests from a later V2 merge) |
| tui | 1,463 pass, 2 skip | same |
| ai | 1,793 pass, 28 skip | same |
| codemode | 1,398 pass | same |
| cli | 320 pass, 9 skip | same |
| desktop | 130 pass, 1 skip | same |
| server | 82 pass, 1 skip | same |
| schema / protocol / util / plugin / http-recorder | 68 / 9 / 95 / 9 / 53 pass | same |
| httpapi-codegen | 98 pass | 97 pass |
| client | 220 pass, 4 fail | same 4 failures |
GitHub Actions passed on a178639f35: typecheck, Linux and Windows unit and e2e jobs, Nix evaluation, and PR standards checks.
Not exercised: native macOS builds, the desktop app, and live provider calls.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This works as described. I checked it on Effect 4.0.1 in two ways:
httpapi-codegen, bun run generate in packages/client fails with Conflicting Effect type reference: string. With this PR, check:generated passes. The only generated change from base is the type reordering in types.ts (+43/−43), and api.ts keeps all 62 Brand.Brand<…> occurrences.LocationLifecycle shutdown: with the base version, the core suite reproduces Fiber.runLoop: Not a valid effect, and browser-idle.test.ts fails. With this PR, it passes.The httpapi-codegen tests (98 pass) and the core location/session tests (33 pass, 2 skip) pass, and typecheck is clean for both packages.
Public API: @opencode/client changes its effect peerDependency from 4.0.0-rc.118 to 4.0.1 (exact pin), so consumers still on the rc need to upgrade. The plugin docs now recommend "effect": "^4.0.0". The HTTP API, OpenAPI spec and CLI config schema are unchanged.
One non-blocking note is inline: the new brand recovery in the codegen depends on Effect internals.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| const brandAstCache = new WeakMap<object, SchemaAST.AST>() | ||
|
|
||
| function brandAst(schema: Schema.Top): SchemaAST.AST { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not blocking, but worth a look. brandAst gets brands back by reading internal fields off schema objects (identifier + schema, fields, members, to/from, records, rest, …). None of those is a public contract. If Effect renames or reshapes any of them in a patch release, brands will silently drop from the generated client types. check:generated would catch that in CI, but only as a diff. A related risk: syncBrandStructure falls back to matching property signatures by index when the names differ (around line 2332), which could put a brand on the wrong property. If possible, keep this traversal small, and ideally drop it once Effect exposes brand metadata again. Otherwise, a short note on which Effect shapes it relies on would help whoever upgrades next.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
802baa0 to
6103a3b
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.