Skip to content

refactor: organize agent hook installation and server owners - #39969

Merged
nwparker merged 2 commits into
mainfrom
module-layout-v2/agent-hooks-next-0d122
Nov 8, 2026
Merged

nwparker merged 2 commits into
mainfrom
module-layout-v2/agent-hooks-next-0d122

Conversation

@nwparker

@nwparker nwparker commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Agent-hook installation and server tests were spread across the domain root, and mixed installer modules forwarded unrelated owners. Group installation, first-work observations, runtime wiring, tool events, transport, WSL relay, and server tests by their concrete responsibilities.

Split local and remote installer definitions into their owning modules and migrate consumers and mocks directly. Move the eager server singleton into the body-bearing server class, retire the empty subclass entry, and update fixture anchors, CLI build/package entries, and live CI selectors. Preserve all existing tests, generated hook commands, remote file semantics, and platform behavior.

Validation: 42 selected non-unit checks passed, including Node/web/CLI types, formatting, lint, and quality gates. All agent-hook tests plus affected mock/caller/CLI/build-selector suites passed: 136 files / 794 tests, with 4 files / 45 tests skipped. CLI and main bundle builds passed; two independent refactor audits accepted the final tree.

The local automatic unit selection exceeded its argument-length limit and fell back to the full repository suite; that phase was stopped and scoped checks used under the repository's fanout exception. The full hosted PR workflow remains required before merge.

Files Added Deleted Net
Test 231 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​911 $\color{#cf222e}{\Huge{\mathbf{−}}}$​837 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​74
Prod 280 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1572 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1523 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​49

@nwparker
nwparker merged commit b5e38ad into main Nov 8, 2026
83 checks passed
brennanb2025 added a commit that referenced this pull request Nov 9, 2026
* Start OpenCode 2 with a picked model through its launch config

OpenCode 2's root command has no --model, so launches that carried one
exited with 'Unrecognized flag'. On supported 2.x releases the PTY launch
hook now moves a literal root --model into OPENCODE_CONFIG_CONTENT and
starts a private server so the TUI reads it. Anything it can't apply is
left as typed.

* Point the sync-fs ratchet baseline at the moved agent-hooks files

#39969 moved the agent-hooks installer files after #39930 wrote the
baseline, so the ratchet saw every moved file as new and failed lint.
Same counts, new paths; installer-utils' 20 split into its two new owners.

* Rewrite only one plain OpenCode command with a real --standalone

A --prompt or --session value spelled --standalone no longer counts as
the option, the cut starts at the previous token's end so its escaped
trailing characters stay, and a newline or shell operator leaves the
command as typed.

* Leave a command with an operator outside quotes as typed

A token that only starts with a quote, such as '--auto'&&echo, could hide
a shell operator; scan each token outside its quotes instead.

* Leave comments and explicit servers as typed

A word starting with # comments out the rest of the line, and --server
means another server that never reads this launch's config.

* Scan for shell operators with each shell's own quoting

cmd quotes only with double quotes and PowerShell escapes with a backtick,
so a posix-only scan could miss an operator they would split on.

* Rewrite only the command shape Orca itself emits

Replace the shell scanners with one check: every argument after the
executable must be exactly quoteStartupArg's output or a bare flag the
builders append, and the prompt must match the body Orca put in the env.
cmd also rejects any divergent token or raw newline. Anything else stays
as typed.

* Test that the launch hook hands the prompt body to the model rewrite
audichuang added a commit to audichuang/orca that referenced this pull request Nov 10, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 10, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 12, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 13, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 14, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 16, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 18, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 18, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 19, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 20, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 20, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 20, 2026
audichuang added a commit to audichuang/orca that referenced this pull request Nov 21, 2026
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