Skip to content

Re-apply message-action normalization and update-runner from v2026.3.1/v2026.3.2 #2207

@alexey-pelykh

Description

@alexey-pelykh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions