Skip to content

feat: scaffold experimental aw-harness TypeScript project (engine: aw)#29783

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/implement-aw-harness-setup
Closed

feat: scaffold experimental aw-harness TypeScript project (engine: aw)#29783
Copilot wants to merge 2 commits intomainfrom
copilot/implement-aw-harness-setup

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 2, 2026

Summary

Implements specs/aw-harness.md as an EXPERIMENTAL engine: aw execution engine built on the Pi SDK (@mariozechner/pi-coding-agent).

⚠️ EXPERIMENTALengine: aw is experimental and subject to breaking changes without notice.

Changes

New: aw-harness/ TypeScript project

A standalone TypeScript project that compiles to aw_harness.cjs (bundled via esbuild):

File Purpose
src/index.ts Entry point — creates AgentSession, runs prompt, disposes
src/types.ts Shared config types (HarnessConfig, SharedHarnessState)
src/loader.ts Reads config.json + prompt.txt from compiler outputs
src/context.ts Assembles prompt from imports: + prompt body
src/user-extensions.ts Loads user-declared Pi extensions from harness.extensions
src/extensions/provider-setup.ts Registers LLM providers from env vars (ANTHROPIC_API_KEY, OPENAI_API_KEY, GITHUB_TOKEN)
src/extensions/cost-tracker.ts Budget gates — warning/critical at configurable token % thresholds
src/extensions/steering.ts Time pressure — injects steering messages near timeout
src/extensions/repair.ts Detects corrupted tool results; injects follow-up on recoverable errors
src/extensions/observability.ts JSONL event stream, context provenance file, GitHub step summary

Tests

  • 76 vitest unit tests across 8 test files
  • Uses vitest (not jest) per spec
  • All dependencies pinned to exact versions

Makefile targets

Target Description
make aw-harness Build + bundle → actions/setup/js/aw_harness.cjs
make deps-aw-harness Install aw-harness/ npm dependencies
make lint-aw-harness TypeScript typecheck
make test-aw-harness Run vitest

make build now depends on aw-harness; make lint now depends on lint-aw-harness.

Experimental marking

  • Runtime stderr warning on every invocation: ⚠️ EXPERIMENTAL: engine: aw is experimental
  • aw-harness/README.md prominently marks as experimental
  • GitHub Actions step summary includes experimental banner
  • Entry point src/index.ts has ⚠️ EXPERIMENTAL header comment

Testing

# Install deps and run tests
make deps-aw-harness
make test-aw-harness

# Build (requires node 22+)
make aw-harness

# Typecheck + lint
make lint-aw-harness

Notes

  • actions/setup/js/aw_harness.cjs is gitignored (43 MB bundle — generated by make aw-harness)
  • Pi SDK integration not yet wired into the Go compiler (engine: aw parsing/compilation is a follow-up)
  • User extension loading, context provenance, and OTel are scaffolded but OTel client is a stub pending actual OTLP library integration

Copilot AI and others added 2 commits May 2, 2026 15:47
Implements specs/aw-harness.md as an EXPERIMENTAL engine: aw execution
engine built on the Pi SDK (@mariozechner/pi-coding-agent).

- Creates aw-harness/ TypeScript project with pinned deps, vitest tests,
  and esbuild bundler
- Implements all 5 Pi extensions: provider-setup, cost-tracker, steering,
  repair, observability
- 75 unit tests covering all modules
- Adds make aw-harness, make deps-aw-harness, make lint-aw-harness targets
- Links aw-harness to make build (aw-harness as build dep) and make lint
- Marks as [EXPERIMENTAL] in entry point, README, step summary, and runtime
  stderr warning

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c34f8c7a-4089-44e1-8a52-edaaa5c215a7

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Remove unused turnCostUsd variable in observability.ts
- Fix cost-tracker fallback to only update when context tokens > current count
- Emit warning when invalid budget config is silently ignored in loader.ts
- Use instanceof Error check in index.ts main() catch handler
- Add critical-message-once test in steering.test.ts
- Add test verifying budget warning is emitted to stderr in loader.test.ts

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c34f8c7a-4089-44e1-8a52-edaaa5c215a7

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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.

2 participants