GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Move service state into InstanceState, flatten service facades by kitlangton · Pull Request #18483 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduces InstanceState as a centralized Effect cache for per-instance service state, replacing scattered module-level mutable state
  • Adds shared memoized service runners (runService) for global singleton services (format, question)
  • Flattens service facade files — merges service.ts into the main module index for permission, snapshot, format, skill, file, and others
  • Deletes the old runtime.ts and instances.ts modules
  • Renames PermissionNext to Permission

Test plan

  • Existing tests pass (bun run test)
  • Typecheck passes (bun run typecheck)
  • New tests for InstanceState and runService

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kitlangton added 16 commits March 20, 2026 20:39
@kitlangton
add InstanceState effect cache
dac6053
@kitlangton
add shared memoized service runner
75bf562
@kitlangton
move global facades to shared service runners
150cb69
@kitlangton
move format state into InstanceState
44c1328
@kitlangton
move format and question to global runners
310a4c5
@kitlangton
move permission state into InstanceState
2f4e32f
@kitlangton
move file time state into InstanceState
a63fd0f
@kitlangton
move provider auth state into InstanceState
733ceb0
@kitlangton
move vcs state into InstanceState
58f7c60
@kitlangton
move vcs state into InstanceState
cb6ec3e
@kitlangton
move skill state into InstanceState
360ec2e
@kitlangton
move file/watcher state into InstanceState, flatten service facades, …
0bd101f
…delete runtime

- File service: InstanceState for cache/fiber, flatten index.ts + service.ts
- FileWatcher: wrap subscription setup in InstanceState, add init()
- Question: flatten index.ts + service.ts
- ProviderAuth: flatten auth.ts + auth-service.ts, remove fn() wrappers
- Account CLI: use Account.runPromise instead of runtime
- Delete effect/runtime.ts and effect/instances.ts (no more centralized runtime)
- Delete runtime.test.ts (no longer applicable)
@kitlangton
flatten skill service facade into skill.ts
3e28539
@kitlangton
flatten format service facade into index.ts
4ce1222
@kitlangton
flatten snapshot service facade into index.ts
57e456f
@kitlangton
flatten permission service facade, rename PermissionNext to Permission
a53db68
@github-actions github-actions Bot added Vouched contributor labels Mar 21, 2026
kitlangton added 2 commits March 20, 2026 23:21
@kitlangton
rename Permission service tag from PermissionNext
e0b6af8
@kitlangton
remove Layer.fresh from File service
0354a5c
@kitlangton kitlangton added the beta label Mar 21, 2026
kitlangton added 9 commits March 20, 2026 23:37
@kitlangton
replace dynamic plugin import in provider/auth with static import, fi…
1588d9c
…x cycle checker
@kitlangton
flatten FileTime service facade into time.ts
3ba400d
@kitlangton
clean up pending questions on dispose
af4db41
@kitlangton
clean up pending permissions on dispose
1d26114
@kitlangton
standardize runPromise inside namespace, flatten Account/Truncate fac…
41bbf08
…ades

- FileWatcher, Vcs, Installation: move runPromise inside namespace
- Truncate: flatten truncate-effect.ts → truncate.ts
- Account: flatten effect.ts → index.ts
- Server: use Vcs.branch() facade instead of raw runPromise
- Auth stays split (dual Schema/Zod types)
@kitlangton
update effect-migration.md to reflect current architecture
76524db
@kitlangton
flatten Auth facade using zod() Schema→Zod interop
fe991e4
@kitlangton
move Auth schema classes inside namespace, use Info.zod for Schema→Zo…
a692f33
…d interop
@kitlangton
move Question log inside namespace, async Installation facades
5fb6787
@kitlangton
add Effect.fn tracing to ProviderAuth state init, fix cycle checker t…
b33d6e2
…runcate path
@kitlangton
kitlangton marked this pull request as ready for review March 21, 2026 04:15
kitlangton added 5 commits March 21, 2026 00:16
@kitlangton
rename instanceState to state in Format and Snapshot for consistency
39ee534
@kitlangton
add InstanceState isolation and disposal tests for File service
c07361c
@kitlangton
parallelize formatter availability checks and cover execution order
9454464
@kitlangton
add instance cleanup to stateful service tests
c853e6b
@kitlangton
add adversarial InstanceState tests: high contention, interleaved dis…
a902ff6
…pose, mutation isolation
opencode-agent Bot added a commit that referenced this pull request Mar 21, 2026
@opencode-agent
Apply PR #18483: Move service state into InstanceState, flatten servi…
9a6a75a
…ce facades
@kitlangton
auto-init file scan on search, reset fiber on failure, async test dis…
5990015
…posal
@kitlangton
kitlangton enabled auto-merge (squash) March 21, 2026 04:47
@kitlangton
kitlangton merged commit 38e0dc9 into dev Mar 21, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kitlangton
kitlangton deleted the effect/instance-state branch March 21, 2026 04:51
@e6qu e6qu mentioned this pull request Mar 22, 2026
docs: Phase 6 — Effect behavioral analysis complete, all 6 phases done e6qu/frankencode#30
Merged
2 tasks done
@coleleavitt coleleavitt mentioned this pull request Apr 21, 2026
fix/memory 20695 coleleavitt/opencode#5
Merged
@twhittock twhittock mentioned this pull request May 4, 2026
Project-level skills missing from available-skills in REST API sessions #25686
Closed
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
@kitlangton
Move service state into InstanceState, flatten service facades (anoma…
d4277e8
…lyco#18483)
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
@kitlangton
Move service state into InstanceState, flatten service facades (anoma…
8a74d76
…lyco#18483)
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
@kitlangton
Move service state into InstanceState, flatten service facades (anoma…
20d65f2
…lyco#18483)
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
@kitlangton
Move service state into InstanceState, flatten service facades (#18483)
d6381da
This was referenced Sep 17, 2026
fix(opencode): run the documented permission.ask plugin hook #47675
Closed
permission.ask plugin hook is defined but not triggered #7006
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

beta contributor Vouched

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@kitlangton
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.