Skip to content

Extract reusable agent harness core - #226

Merged
qduc merged 2 commits into
mainfrom
agent-harness-core
Nov 8, 2026
Merged

qduc merged 2 commits into
mainfrom
agent-harness-core

Conversation

@qduc

@qduc qduc commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

What changes

Extract Term2's turn loop into the workspace package @qduc/agent-harness-core, with Term2 as its first consumer. A host supplies its model, tools, history and typed application context; it accepts events before the turn advances. Root and nested turns can set model- and tool-call caps, and compaction remains opt-in.

The dependency-free package is embedded in Term2's distribution. A packed-install test runs concurrent turns from a plain JavaScript consumer. Term2-specific policy and pricing stay in Session; the engine import guard has no remaining allowlisted edges.

Provider affinity, model factory state and OAuth account ownership are scoped to requests or application-owned instances. Refreshes are coordinated per account within one app, including cancellation, account removal and retry. Separate processes sharing a credential file still need external coordination.

Verification

  • CI passed quality, static tests, integration, end-to-end, provider black-box and port checks on the current head, including the 14-hop message-path budget.
  • Independent verification covered the packed package, concurrent contexts, nested authority, provider affinity and WebSocket dispatch, and OAuth account/refresh isolation.
  • Local integration and end-to-end runs encountered environment limitations in nested shell execution and /proc PTY visibility; those tiers passed in CI.
  • The design prerequisites are merged: Fix v2 parsing of native task tool tracking agent-runtime#2 and Upgrade Electron to a Node 24 runtime chat#39. ChatForge's Windows desktop package and real rendered UI were not tested as part of its prerequisite change.

Closes #224

@qduc
qduc marked this pull request as ready for review November 8, 2026 11:28
@qduc
qduc merged commit 41bbca5 into main Nov 8, 2026
7 checks passed
qduc added a commit that referenced this pull request Nov 9, 2026
docs: mark agent harness plan in progress after #226
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.

Extract the agent harness core from src/engine

1 participant