Context
PR #2191 wholesale-restored src/infra/outbound/message-action-runner.ts and src/infra/update-runner.ts. This discarded clean upstream improvements from v2026.3.1/v2026.3.2.
Audit report: hq/engineering/notes/post-remediation-audit-b3b4.md
message-action-runner.ts (v2026.3.2, all improvements)
1. normalizeMessageActionInput extraction
A 45-line inline target/channel inference block (legacy to/channelId handling, inferred targets, channel inference, applyTargetToParams) was extracted into a single normalizeMessageActionInput() call from a dedicated message-action-normalization.js module.
Dependency: message-action-normalization.js — verify this module exists in the fork.
2. toolContext.currentChannelProvider fallback
Channel resolution now accepts a toolContext parameter with currentChannelProvider. When no explicit channel is specified, the tool's originating channel is used as fallback. Prevents mis-routing messages to wrong channels.
What to do: Add toolContext?: { currentChannelProvider?: string } param to resolveChannel. Add source === "tool-context-fallback" handling. Pass input.toolContext through all call sites.
update-runner.ts (v2026.3.1/v2026.3.2, large feature + fixes)
3. Git-based self-update mode (v2026.3.1, large feature)
Complete self-update flow for git-installed dev mode: working tree cleanliness check, upstream fetch, preflight worktree validation (checkout/deps/build/lint for up to 10 candidate commits), rebase or tag-based checkout, dependency install, build, ui:build, doctor run, UI assets verification.
Dependencies: control-ui-assets.js, detect-package-manager.js, update-channels.js, package-tag.js, stable-node-path.js — verify which exist.
4. globalInstallFallbackArgs (v2026.3.1)
Fallback install args (e.g., --omit=optional) when primary npm global install fails. Better error resilience.
5. resolveStableNodePath for doctor (v2026.3.2)
Bug fix: resolves symlinks to stable Node.js paths, preventing issues when Node.js is updated between update-runner invocation and doctor execution.
6. normalizePackageTagInput (v2026.3.2)
Extracts tag normalization to dedicated package-tag.js module. Cleaner, reusable.
Exit Criterion
Message-action normalization extracted. Tool context fallback wired. Update-runner improvements applied (git-mode is optional given scope). Tests pass.
Context
PR #2191 wholesale-restored
src/infra/outbound/message-action-runner.tsandsrc/infra/update-runner.ts. This discarded clean upstream improvements from v2026.3.1/v2026.3.2.Audit report:
hq/engineering/notes/post-remediation-audit-b3b4.mdmessage-action-runner.ts (v2026.3.2, all improvements)
1.
normalizeMessageActionInputextractionA 45-line inline target/channel inference block (legacy
to/channelIdhandling, inferred targets, channel inference,applyTargetToParams) was extracted into a singlenormalizeMessageActionInput()call from a dedicatedmessage-action-normalization.jsmodule.Dependency:
message-action-normalization.js— verify this module exists in the fork.2.
toolContext.currentChannelProviderfallbackChannel resolution now accepts a
toolContextparameter withcurrentChannelProvider. When no explicit channel is specified, the tool's originating channel is used as fallback. Prevents mis-routing messages to wrong channels.What to do: Add
toolContext?: { currentChannelProvider?: string }param toresolveChannel. Addsource === "tool-context-fallback"handling. Passinput.toolContextthrough all call sites.update-runner.ts (v2026.3.1/v2026.3.2, large feature + fixes)
3. Git-based self-update mode (v2026.3.1, large feature)
Complete self-update flow for git-installed dev mode: working tree cleanliness check, upstream fetch, preflight worktree validation (checkout/deps/build/lint for up to 10 candidate commits), rebase or tag-based checkout, dependency install, build, ui:build, doctor run, UI assets verification.
Dependencies:
control-ui-assets.js,detect-package-manager.js,update-channels.js,package-tag.js,stable-node-path.js— verify which exist.4.
globalInstallFallbackArgs(v2026.3.1)Fallback install args (e.g.,
--omit=optional) when primary npm global install fails. Better error resilience.5.
resolveStableNodePathfor doctor (v2026.3.2)Bug fix: resolves symlinks to stable Node.js paths, preventing issues when Node.js is updated between update-runner invocation and doctor execution.
6.
normalizePackageTagInput(v2026.3.2)Extracts tag normalization to dedicated
package-tag.jsmodule. Cleaner, reusable.Exit Criterion
Message-action normalization extracted. Tool context fallback wired. Update-runner improvements applied (git-mode is optional given scope). Tests pass.