Skip to content

fix(config): harden scoped dependency loading#5

Closed
Astro-Han wants to merge 12 commits into
devfrom
fix/config-deps-followup
Closed

fix(config): harden scoped dependency loading#5
Astro-Han wants to merge 12 commits into
devfrom
fix/config-deps-followup

Conversation

@Astro-Han

Copy link
Copy Markdown
Owner

Summary

  • harden config-scoped dependency installs and waiting behavior
  • follow transitive config dependencies across local tool and plugin helpers
  • ignore type-only dependency signals while preserving runtime aliases
  • include the supporting Windows cleanup and lock reliability fixes already in this branch stack

Verification

  • bun test --timeout 30000 test/config/config.test.ts test/tool/registry.test.ts test/plugin/loader-shared.test.ts
  • git diff --check

Notes

@Astro-Han Astro-Han force-pushed the fix/config-deps-followup branch from c268413 to 6b467c4 Compare April 17, 2026 05:18
@Astro-Han

Copy link
Copy Markdown
Owner Author

Superseded by #6, which uses the correct head branch: fix/config-scoped-deps-review.

@Astro-Han Astro-Han closed this Apr 17, 2026
@Astro-Han Astro-Han deleted the fix/config-deps-followup branch April 17, 2026 16:39
Astro-Han added a commit that referenced this pull request Apr 27, 2026
PawWork users on their own provider keys should not silently inherit
global Claude Code instructions as their PawWork baseline (issue #230,
acceptance #5). Gates the fallback push behind a Runtime.isPawWork()
check so the existing opt-out flag still works for plain opencode CLI
users; project-level CLAUDE.md remains as compatibility (#6).

The lookup also routes through Global.Path.home so OPENCODE_TEST_HOME
can stub the home directory deterministically — Bun's os.homedir() is
locked at process start, which would otherwise make the global Claude
path untestable under Bun's test runner.

Tests cover the five scenarios from acceptance #8: fresh install, project
AGENTS.md, project CLAUDE.md compatibility fallback, PawWork global
AGENTS.md, and the now-ignored ~/.claude/CLAUDE.md. A non-PawWork
regression test guards the Runtime.isPawWork() gate so an accidental
condition inversion would fail the suite.
Astro-Han added a commit that referenced this pull request Apr 27, 2026
PawWork users on their own provider keys should not silently inherit
global Claude Code instructions as their PawWork baseline (issue #230,
acceptance #5). Gates the fallback push behind a Runtime.isPawWork()
check so the existing opt-out flag still works for plain opencode CLI
users; project-level CLAUDE.md remains as compatibility (#6).

The lookup also routes through Global.Path.home so OPENCODE_TEST_HOME
can stub the home directory deterministically — Bun's os.homedir() is
locked at process start, which would otherwise make the global Claude
path untestable under Bun's test runner.

Tests cover the five scenarios from acceptance #8: fresh install, project
AGENTS.md, project CLAUDE.md compatibility fallback, PawWork global
AGENTS.md, and the now-ignored ~/.claude/CLAUDE.md. A non-PawWork
regression test guards the Runtime.isPawWork() gate so an accidental
condition inversion would fail the suite.
Astro-Han added a commit that referenced this pull request Apr 27, 2026
…k mode

PawWork users on their own provider keys should not silently inherit
global Claude Code instructions as their PawWork baseline (issue #230,
acceptance #5). Gates the global fallback push behind a
Runtime.isPawWork() check so the existing opt-out flag still works for
plain opencode CLI users; project-level CLAUDE.md remains as
compatibility (acceptance #6) and is unaffected here.

The lookup also routes through Global.Path.home so OPENCODE_TEST_HOME
can stub the home directory deterministically — Bun's os.homedir() is
locked at process start, which would otherwise make this code path
untestable under Bun's test runner.

Tests cover the five fallback scenarios from acceptance #8: fresh
install, project AGENTS.md, project CLAUDE.md compatibility fallback,
PawWork global AGENTS.md, and the now-ignored ~/.claude/CLAUDE.md. A
non-PawWork regression test guards the Runtime.isPawWork() gate so an
accidental inversion would fail the suite.
Astro-Han added a commit that referenced this pull request May 13, 2026
AstroHan W1 retest #5: the user bubble + agent round toolbars rendered
only an `aria-label` on each action button, so pointer users had no
hover affordance explaining what the icons did. Reusing the existing
`Tooltip` component (already used by the legacy `<IconButton>` toolbar
path in `user-message-display.tsx`) restores parity while keeping the
W1 leaves context-free — the tooltip body is the same i18n-resolved
string the caller passes in via `labels.{copy,copied,reset,fork}`.

Side-effect: importing `./tooltip` from `session-turn-agent-round.tsx`
pulls in the Kobalte client-only module, which throws when the test
runner evaluates it server-side. Pure helpers
(`selectFirstAssistant`, `selectLatestAssistant`, `isInterrupted`,
`computeElapsedSec`) move into a sibling `session-turn-agent-round-helpers.ts`
so the test imports them without dragging the Kobalte chain. The
component re-exports them under the original name to keep callers
stable.
Astro-Han added a commit that referenced this pull request May 13, 2026
AstroHan's third W1 retest (msg=362e9b72) raised two visual issues
on the trow block; both land in `session-turn-trow-block.css`.

**#2 — per-tool box wrapper.** Slice 11b.1 #5 B+ added a transparent
+ 1px --border-weaker frame around each tool's rich body
(`data-slot="trow-result-body"`) as the L417-spec scope marker.
AstroHan reported the chrome makes tools look like isolated cards
and (when bash is expanded) stacks on top of bash-output's own
border. The W1 intent is a flat stacked feed where tools 叠在一起.
The wrapper stays — it is still the scope boundary for the inner
chrome typography reset — but its visual chrome (border / radius /
padding) is removed.

**#4 — chev direction + inner tool chev size.** Two parts:

  (a) Trow summary chev direction. The third retest re-defined the
      affordance: 折叠朝右、展开朝下. The second-retest fix that
      pointed the chev up on `details[open]` is reverted —
      file-tree, Collapsible, and the W1 mocks all use down-when-
      open, so trow should match. Default `transform: rotate(-90deg)`
      (chevron-down → right when collapsed); `details[open]` flips to
      `rotate(0)` (natural down).

  (b) Inner Collapsible.Arrow chev size inside the trow result body.
      AstroHan flagged that the chev inside each tool trigger ("执行
      命令 XXXX" row) renders as a "大 chevron" — Collapsible's default
      is 16px, but the W1 caption surface (DESIGN.md L412 lock) caps
      the chev at 12px. Scoped reset fires only inside
      `[data-slot="trow-result-body"]`, so the Collapsible default
      elsewhere (file-tree, settings, etc.) is unaffected.
Astro-Han added a commit that referenced this pull request May 17, 2026
…poser

Round 4 crosscheck surfaced two remaining issues:

- Claude P1: Restore in Settings was still a silent no-op for returning
  users (sessionCount > 0). Even after clearing both seen and dismissed,
  firstTimeVisitor stays false because of the sessionCount check. The
  button promised recovery that could not happen. Settings now consults
  useSync and hides the restore button once any session exists.
- Claude P2 #5: prefill merged user-typed content with the suggestion by
  joining text parts, which silently dropped file/agent @-mentions. When
  prompt.dirty() is true, prefill now leaves the composer untouched and
  only refocuses. No corruption path remains.

Also normalize sessionCount to sync.data.session.length (it is Session[],
not a record map, confirmed via use-session-blockers.ts:33).
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