Skip to content

Make --typecheck a true compile-only mode in launcher#47

Merged
pelikhan merged 2 commits into
mainfrom
copilot/rig-tasks-daily-evaluation-2026-07-23
Jul 23, 2026
Merged

Make --typecheck a true compile-only mode in launcher#47
pelikhan merged 2 commits into
mainfrom
copilot/rig-tasks-daily-evaluation-2026-07-23

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

--typecheck previously continued into runtime execution after successful typecheck, which caused misleading ECONNREFUSED failures in CI environments without a Copilot server. The launcher now treats typecheck as a compile-only path and exits before runtime/session setup in both program-file and inline-stdin modes.

  • Launcher control-flow fix

    • Return immediately after successful typecheck in:
      • program-file stdin mode (runRootAgentFromStdin)
      • inline program stdin mode (runProgramCodeFromStdin)
    • Prevents Copilot runtime initialization and root-agent execution in --typecheck mode.
  • Typecheck diagnostics clarity

    • typecheckProgram now supports a display path so inline stdin errors are reported as Typecheck failed for <stdin> in the primary error message (instead of temp file path in the header).
  • Inline import injection hardening

    • withInjectedRigImport now injects only referenced symbols (agent, p, s) rather than always injecting all three.
    • Avoids noUnusedLocals/TS6133 failures introduced by synthetic unused imports during inline typecheck.
  • Docs alignment

    • Updated launcher docs in README.md and skills/rig/SKILL.md to state that --typecheck typechecks and exits without execution.
if (options.typecheck) {
  await typecheckProgram(resolvedPath, cwd);
  return; // no runtime/session setup, no agent execution
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix package health checker issue for daily evaluation Make --typecheck a true compile-only mode in launcher Jul 23, 2026
Copilot AI requested a review from pelikhan July 23, 2026 13:57
@pelikhan
pelikhan marked this pull request as ready for review July 23, 2026 13:58
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — approving. The fix is correct, well-scoped, and the test suite now properly asserts the compile-only contract.

📋 Key Themes & Highlights

Positive Highlights

  • ✅ Root cause addressed at both call sites (runRootAgentFromStdin and runProgramCodeFromStdin) — no partial fixes
  • ✅ Tests upgraded from 'does not reject' to asserting createSession is not called — a proper regression spec
  • ✅ New inline-stdin test closes the coverage gap for that mode
  • withInjectedRigImport hardening is a neat fix: only injecting referenced symbols avoids synthetic TS6133 failures cleanly
  • displayPath parameter keeps error messages user-friendly without leaking temp paths

Minor Observation

The agent detection regex (/agent\s*\(/u) will also match a user-defined local function named agent, injecting an import that shadows it. This is a pre-existing edge case (previously the import was always injected), so it is out of scope here — worth noting for a future hardening pass.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 32.8 AIC · ⌖ 5.81 AIC · ⊞ 6.3K
Comment /matt to run again

@pelikhan
pelikhan merged commit f155c08 into main Jul 23, 2026
11 checks passed
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.

[rig-tasks] Daily rig evaluation — 2026-07-23 — 4/5 passed

2 participants