Skip to content

fix+refactor(vcs): fix HEAD filter bug and effectify VcsService#17829

Merged
kitlangton merged 2 commits intodevfrom
effectify-vcs
Mar 16, 2026
Merged

fix+refactor(vcs): fix HEAD filter bug and effectify VcsService#17829
kitlangton merged 2 commits intodevfrom
effectify-vcs

Conversation

@kitlangton
Copy link
Contributor

@kitlangton kitlangton commented Mar 16, 2026

Summary

  • Fix inverted endsWith(\"HEAD\") filter in Vcs branch detection — was skipping HEAD events instead of filtering for them, so BranchUpdated never fired from the native watcher
  • Convert Vcs from Instance.state namespace to an Effect ServiceMap.Service on the Instances LayerMap
  • Extract InstanceContext to its own file (instance-context.ts) to break circular imports as more services join the LayerMap
  • Add shared withServices test fixture and watcherConfigLayer for instance-scoped Effect service tests
  • Add 4 Vcs tests: branch read (git/non-git), BranchUpdated event on HEAD change, branch state update after HEAD change

Restacked from #17634 onto dev after parent merge.

Testing

  • bun run test test/project/vcs.test.ts test/file/watcher.test.ts
  • bunx tsgo --noEmit

Two tests pass (branch() reads current branch correctly).
Two tests fail: BranchUpdated never fires because the FileWatcher
event filter in vcs.ts has an inverted condition — it skips HEAD
changes instead of filtering for them.
Convert Vcs from Instance.state namespace to an Effect ServiceMap.Service
on the Instances LayerMap. Uses Instance.bind for the Bus.subscribe
callback (same ALS pattern as FileWatcherService). Branch state is
managed in the layer closure with scope-based cleanup.
@kitlangton kitlangton changed the title stack: effectify-vcs fix+refactor(vcs): fix HEAD filter bug and effectify VcsService Mar 16, 2026
@kitlangton kitlangton merged commit e5cbecf into dev Mar 16, 2026
13 checks passed
@kitlangton kitlangton deleted the effectify-vcs branch March 16, 2026 17:59
ConanXu-math pushed a commit to ConanXu-math/opencode that referenced this pull request Mar 17, 2026
e6qu pushed a commit to e6qu/frankencode that referenced this pull request Mar 18, 2026
The file watcher was ignoring HEAD changes instead of filtering
non-HEAD changes, so branch switches were never detected.

Upstream: anomalyco/opencode#17829 (e5cbecf)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
e6qu added a commit to e6qu/frankencode that referenced this pull request Mar 18, 2026
* fix(vcs): fix inverted HEAD filter in watcher (backport B8 #17829)

The file watcher was ignoring HEAD changes instead of filtering
non-HEAD changes, so branch switches were never detected.

Upstream: anomalyco/opencode#17829 (e5cbecf)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>

* fix(core): detect context_length_exceeded in API call errors (backport B1 #17748)

Parse response body for error code so providers returning
context_length_exceeded are correctly classified as context overflow.

Upstream: anomalyco/opencode#17748 (e718db6)

* fix(util): log ZodError issues on schema validation failure (backport B5)

Print the specific validation issues alongside the stack trace to make
debugging schema mismatches easier.

* fix(tui): check for selected text in dialog escape handler (backport B7 #16779)

Check getSelectedText() instead of just getSelection() so escape
correctly closes dialogs when a selection object exists but has no text.

Upstream: anomalyco/opencode#16779 (a64f604)

* fix(ui): wrap question option descriptions instead of truncating (backport B6 #17782)

Replace overflow:hidden/text-overflow:ellipsis with overflow-wrap:anywhere
so long descriptions are visible. Remove the now-redundant data-custom override.

Upstream: anomalyco/opencode#17782 (51fcd04)

* fix(opencode): apply message transforms during compaction (backport B2 #17823)

Run Plugin.trigger("experimental.chat.messages.transform") on a
structuredClone of messages before passing them to the compaction model.

Upstream: anomalyco/opencode#17823 (4cb2996)

* fix(opencode): forward session permission ruleset to LLM stream (backport B3 #17064)

Add permission field to StreamInput and merge it with agent permissions
when computing disabled tools. Forward session.permission from prompt.ts.

Upstream: anomalyco/opencode#17064 (c2ca149)

* fix(opencode): add prompt schema validation debug logs (backport B4 #17812)

Log info and part schema validation failures before persisting to help
diagnose data corruption issues.

Upstream: anomalyco/opencode#17812 (fee3c19)

---------

Co-authored-by: Kit Langton <kit.langton@gmail.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Johannes Loher <johannes.loher@tngtech.com>
Co-authored-by: Adrian Mârza <adi11235 at gmail dot com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
Co-authored-by: DS <78942835+Tarquinen@users.noreply.github.com>
Co-authored-by: Jason Quense <monastic.panic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant