Files
OmniRoute/docs/sessions/20260714-issue-agent-executable-triage/04_IMPLEMENTATION_STRATEGY.md
Diego Rodrigues de Sa e Souza 04683029a6 fix(build): exec native esbuild binary directly in prepublish (dast-smoke base-red) (#9558)
* fix(build): exec native tool binaries directly in runBuildTool

#8858 routed every resolved local bin through process.execPath to avoid
Windows .cmd shims — but esbuild >=0.25 ships bin/esbuild as the NATIVE
platform executable (ELF on Linux), so Node parsed machine code as JS and
build:cli died with 'SyntaxError: Invalid or unexpected token', turning
dast-smoke red for every PR.

runBuildTool now sniffs the entry's magic bytes (ELF / Mach-O / PE) and
execs native binaries directly; JS entries keep going through this Node
binary (the .cmd-shim avoidance #8858 wanted).

Validation (RED->GREEN on this box):
- RED: node node_modules/esbuild/bin/esbuild --version -> SyntaxError (ELF)
- GREEN: the exact failing CI step reproduced via the new logic bundles
  open-sse/mcp-server/server.ts successfully (4.2MB output, 1.3s).

* fix(docs): add MDX frontmatter to the 20 remaining docs without it

Same failure class as AGENTROUTER_WAF (#9503) and DOCKER_RELEASE_CHANNELS
(this run's dast-smoke red): any doc without frontmatter breaks the
fumadocs MDX loader during next build, killing build:cli/dast-smoke for
every PR. Swept ALL of docs/ (i18n mirrors excluded) in one pass so this
class cannot recur one file at a time.

* docs(env): document OMNIROUTE_INTERNAL_SERVICE_TOKEN(+_FILE), OPENROUTER_PROVIDER_STATS_* and embedded-Redis binding vars

Pre-existing env/docs contract drift from recently merged features made
check:env-doc-sync red for any docs-touching PR. Values and defaults read
from the defining modules (internalServiceAuth.ts, openrouterProviderStats.ts).

* fix(build): resolve bundled npm-cli.js in the standard Unix layout + safe npm fallback off-Windows

The opencode-plugin step hard-failed on GitHub runners because
resolveBundledNpmEntry only looked next to the node binary (Windows zip
layout); hostedtoolcache Node keeps npm at <prefix>/lib/node_modules/npm.
Added that candidate, and when neither exists on non-Windows the step now
falls back to plain 'npm' — the .cmd-shim hazard #8858 avoids is
Windows-only.

* test(mutation): register xai-agent-tools-passthrough.test.ts in stryker tap.testFiles

The test landed on release/v3.8.50 covering
open-sse/handlers/chatCore/passthroughHelpers.ts without the stryker
registration, so Fast Quality Gates' drift detection reds any PR that
carries it. Mechanical registration so its mutant kills count.

---------

Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
2026-08-06 02:19:57 -03:00

3.2 KiB

title, version, lastUpdated
title version lastUpdated
Issue-Agent Executable Triage: Implementation Strategy 3.8.50 2026-08-06

Issue-Agent Executable Triage: Implementation Strategy

Machine status: in_progress

Phase Plan

phase work package dependency exit evidence status
P1 verify/finish routing-policy contract and failure semantics existing AC1 seam actual chat route test proves policy consumption and non-2xx mapping in_progress
P2 introduce durable execution lifecycle persistence P1 records transitions, request/prompt, output, accounting, terminal error pending
P3 normalize actionable triage result P2 stable API result schema derived from completion pending
P4 implement terminal outcome controls P2 provider failure, timeout, budget stop transition tests pending
P5 release validation and PR review P1-P4 focused tests, route gate, relevant typecheck/CI evidence pending

Architecture

  1. Keep src/app/api/issue-agent/runs/route.ts as the API adapter: validation, feature gate, and response formatting only.
  2. Keep the standard chat POST as the routing boundary; do not add a parallel provider invocation path.
  3. Extract lifecycle persistence and result normalization into focused src/lib/issueAgent/ modules. Do not overload the existing pre-execution audit writer with unrelated transport behavior.
  4. Use typed execution outcomes so provider failure, abort/timeout, and budget termination are distinguishable before HTTP mapping and persistence.
  5. Add tests from the actual route down to a mocked external provider boundary; use unit tests for pure normalization and lifecycle state transitions.

Quality Controls

control command or review threshold
route contract npm run check:route-validation:t06 pass
AC1 route behavior focused bun test issue-agent route/execution suites policy and provider/model assertions pass
AC2-AC4 lifecycle/result/terminal-outcome suites all required states persist and API matches
static safety npm run typecheck:core distinguish new failures from existing omniglyph blocker
patch integrity git diff --check origin/main...HEAD pass