Skip to content

Skip visit writes for active worktree reselect - #4417

Merged
nwparker merged 1 commit into
mainfrom
nwparker/worktree-activation-helper-noop
Jun 1, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/worktree-activation-helper-noop

Conversation

@nwparker

@nwparker nwparker commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • skip focus-recency and nav-history writes for a plain reselect of the already-active worktree in terminal view
  • keep visit recording for meaningful activations that switch repo/view or carry startup/setup/default-tab work
  • keep sidebar reveal behavior for the no-op case
  • document the helper-level fanout follow-up in the renderer memory profile notes

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/worktree-activation-created-agent.test.ts src/renderer/src/store/slices/store-cascades.test.ts src/renderer/src/lib/session-write-subscriber.test.ts
  • pnpm run typecheck
  • pnpm exec oxlint src/renderer/src/lib/worktree-activation.ts src/renderer/src/lib/worktree-activation-created-agent.test.ts src/renderer/src/store/slices/worktrees.ts src/renderer/src/store/slices/store-cascades.test.ts src/renderer/src/lib/session-write-subscriber.test.ts
  • git diff HEAD --check

@nwparker
nwparker merged commit 9769b85 into main Jun 1, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/worktree-activation-helper-noop branch June 1, 2026 23:06
@nwparker

nwparker commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Post-merge addendum: profiling evidence and regression risk

This PR was already merged; adding the missing review context explicitly.

Profiling/data:

  • After Avoid no-op worktree activation fanout #4416, the higher-level activation helper still wrote focus recency/nav history for a plain reselect of the active worktree.
  • That meant the no-op UI action could still fan out into persistence work even though the store-level active-worktree setter no longer notified.

Regression risk:

  • Recency/history could be under-recorded if the skip condition is too broad. The implementation keeps writes for actual repo/view switches and activation calls that include startup/setup/default-tab work.
  • Sidebar reveal behavior remains for the no-op case, so the UI affordance is preserved while avoiding persistence churn.

Validation already run before merge:

  • Vitest for worktree activation, store cascades, and session-write subscriber behavior.
  • Typecheck, oxlint, git diff --check.

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
AmethystLiang added a commit that referenced this pull request Nov 21, 2026
…journal/ (#46397)

* feat(bots): journal each closed item and its PRs in the bot's memory/journal/

When a bot's item closes, Orca appends one line per linked PR to
memory/journal/YYYY-MM.md in the bot's home, from Items and the desktop's
PR cache: '- 2026-11-21 | item #1006 | PR #4417 merged | <title>'. No model
and no bot writes it, so finished work stays findable with grep after
status leaves MEMORY.md. Only items from chats acting for the owner are
journaled; each line is written once, on the bot's memory queue.

* fix(bots): journal each close once by item and PR, and retry lines a busy file kept out

A close is one line by its date, item and PR, so a PR state the cache
learns later never writes it twice. A month file that keeps changing under
a write throws, so the pass keeps its mark and writes those lines next
time. A pass reads up to 100 closed items.

* fix(bots): journal each close once, by its item, and judge the owner by the conversation root

A close is written once, all its lines in one append, so a later pass that
sees the same close with newer PR state or links adds nothing. An unread
PR is named by its number. The owner check looks up the conversation's
/clear root, as other acts-for checks do.

* test(bots): pin which chats' closes the journal takes, by root and with old event runs

* fix(bots): journal every close in the window, catch up after a restart, keep repos apart

A pass reads closed items page by page until the window is covered, so a
burst of closes is never cut at the first page. On start, one pass catches
up on closes made while Orca was off. PRs are told apart by their full
reference, so two repos' #7 are two lines, named with their repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant