Skip to content

feature/0.4 subagents prep - #1

Merged
MacroSony merged 64 commits into
mainfrom
feature/0.4-subagents-prep
Aug 2, 2026
Merged

feature/0.4 subagents prep#1
MacroSony merged 64 commits into
mainfrom
feature/0.4-subagents-prep

Conversation

@MacroSony

Copy link
Copy Markdown
Owner
  • Prepare web editor for profile work
  • Verify tracked dist output in CI
  • Restore tool policy state before reload
  • Clarify policy semantics and harden release checks
  • Harden tool policy against extension reactivation
  • Align development with Pi 0.80.6
  • Add native agent profile core
  • Add one-shot agent profile workflow
  • Add fresh-session profile autoload
  • Fix fresh-session profile detection
  • Extract shared agent profile services
  • Prototype Pi SDK subagent execution
  • Complete subagent contract boundary
  • Add dedicated subagent API entry point
  • Extract extension runtime services
  • Migrate web editor client to typed modules
  • Add optional subagent backend registry
  • Split subagent contract modules
  • Exclude source files from npm package
  • Stabilize lifecycle and stack editing
  • Add initial isolated subagent runtime
  • Describe shared-user subagent boundaries
  • Run read-only subagents in foreground subprocesses
  • Add approval-gated forge subagent tool
  • Document foreground subagent workflow
  • Expose subagent profiles to the main agent
  • Document subagent profile discovery
  • Support Pi 0.80.10 subagent authentication
  • Document Pi 0.80.10 compatibility
  • Omit image data from subagent reports
  • Sanitize subprocess report transport
  • Document binary-safe subagent reports
  • Drain subagent subprocesses before cancellation
  • Bound retained subagent reports
  • Allow trusted unattended subagent invocation
  • Prepare 0.4.0 beta.1 release
  • Migrate subagent execution ownership to @zihanw/pi-subagent-runtime
  • Target Pi 0.82.1 and complete runtime-package type migration
  • Record the 0.4.0 exit plan and backend-selection decision
  • Make the subagent execution backend selectable through layered config
  • Mark backend selection complete in the 0.4.0 exit plan
  • Unify fingerprints and validators with the runtime; remove legacy surfaces
  • Adopt the published subagent runtime prerelease
  • Make foreground subagent timeouts configurable
  • feat(subagents): add project-scoped profile delegation policy
  • fix(subagents): keep approval dialog within viewport
  • test(web-editor): characterize existing browser behavior
  • build(web-editor): prepare Vue client pipeline
  • refactor(web-editor): mount editor through Vue shell
  • refactor(web-editor): make legacy bridge lifecycle-safe
  • refactor(web-editor): migrate policy and regex tabs to Vue
  • refactor(web-editor): migrate stack settings tab to Vue
  • feat(web-editor): add agent profile inspection
  • feat(web-editor): add agent profile authoring
  • feat(web-editor): apply and delete agent profiles
  • refactor(web-editor): migrate stack metadata to Vue
  • refactor(web-editor): migrate stack item editor to Vue
  • fix(web-editor): enforce single auto-activation on profile save
  • feat(web-editor): configure per-profile subagent delegation
  • fix(web-editor): restore viewport-constrained scrolling layout
  • fix(web-editor): remove narrow-mode whitespace in the stack workspace
  • fix(web-editor): usable narrow item editor and collapsible diagnostics
  • docs: document the profile editor and delegation card; mark Milestone 2 landed
  • release: prepare pi-forge 0.4.0

MacroSony added 28 commits July 26, 2026 06:03
Replace Forge's private backend registry and process backends with the
public runtime package. createForgeSubagentRuntime now drives an
ExecutionRuntime with both migrated backends: profiles, prompt-stack
resolution, host compilation through prepareSubagentHostPlan(), approval
plan construction via createAgentExecutionPlan(), and the response/report
product surfaces are unchanged, while preflight, sealing, lifecycle,
cancellation, and receipts are runtime-owned.

- Forge requests map to runtime intents with profile/prompt-stack
  provenance fingerprints; the sealed runtime execution fingerprint is
  the single value displayed for approval and bound to execution
- takeReport bridges runtime run ids to backend prepared-run reports
- deleted: SubagentBackendRegistry, PiSubprocessBackend,
  subprocess bridge/report modules and their tests (moved to the runtime
  package), the registry-era fake backend helper, and the registry-bound
  PiSdkIsolatedBackend research adapter whose SDK preparation findings
  are now productized in the runtime's shared preparation gate
- the self-contained SDK spike scripts/test remain; docs mark the
  superseded in-package registry design as historical context
- dogfood test prepares and executes through both pi-subprocess-readonly
  and pi-rpc-readonly with the unchanged approval/response surfaces
Update the supported @earendil-works/pi-* package set from 0.80.10 to
0.82.1 across peer/dev dependencies and user documentation, and finish
the post-migration alignment with @zihanw/pi-subagent-runtime:

- subagent host contract re-exports the runtime's portable execution
  types and canonical/fingerprint helpers instead of parallel local
  definitions, keeping one portable source of truth
- host compilation passes the runtime-owned PromptRuntime (now including
  contextFiles) directly, and requests declare the shared-user execution
  boundary explicitly
- tests track the runtime-owned prompt-runtime fingerprint
- remove the local .pi/settings.json self-load leftover

npm run verify passes: 170 core tests, browser tests, typecheck,
generated-client, dist, and package checks.
Capture the agreed design decisions: backend selection lives in layered
configuration (global default, trusted-project override, explicit
per-run --backend) rather than agent-profile schema, with no silent
fallback; pi-forge invests in reviewable policy-bound delegation depth
rather than orchestration breadth; pi-forge 0.4.0 pins an exact
pi-subagent-runtime version without requiring its 0.1 stabilization.

Order the remaining work: integration finish (backend exposure,
fingerprint semantics, conversation fingerprint, validation dedupe),
small runtime API additions, the runtime publish story, legacy cleanup
and doc alignment, subprocess dogfooding, profile UI, and release
readiness with explicit non-goals.
Backend selection was previously a fixed construction default, leaving
the registered pi-rpc-readonly backend unreachable from the product.
Selection is now resolved per run as: explicit override, trusted project
subagents.backend, user-owned global subagents.backend, built-in
pi-subprocess-readonly. There is deliberately no fallback when the
resolved backend is unavailable, matching the runtime contract.

- /forge-agent plan|run accept [--backend <id>] with completions, and
  /forge-agent backends marks the resolved default and warns about
  unregistered configured backends
- forge_subagent gains an optional backend parameter honored only for
  interactively approved runs; trusted-project unattended invocation is
  pinned to the configured default and rejects overrides fail-closed
- forge_subagent_profiles reports the default backend and its source
- PI_FORGE_GLOBAL_CONFIG_PATH keeps tests hermetic against the real
  user global config
- README (EN/zh-CN), FEATURES, and CHANGELOG document the configuration
  and the now-reachable RPC backend

npm run verify passes: 173 core tests, browser tests, typecheck,
generated-client, dist, and package checks.
…faces

Fingerprint semantics (exit-plan item 1): AgentExecutionPlan now carries
the runtime-issued conversationFingerprint and executionFingerprint as
required createAgentExecutionPlan() inputs. The host no longer computes
either value: subagentExecutionFingerprint is removed, the recomputation
check in validateAgentExecutionPlan() is gone, and the runtime path no
longer overwrites a host-computed value after construction. Substitution
detection remains the runtime's sealed-plan binding. The conversation
fingerprint is surfaced in /forge-agent plan, the approval summary, the
full-prompt viewer, and forge_subagent plan details.

Validation dedupe: src/subagent/validation.ts now re-exports and adapts
the runtime core validators (access/limit requests and receipts, prompt
runtime, backend descriptor, access enforcement, patterns, helpers)
instead of maintaining parallel portable implementations. The richer
host access-receipt cross-checks, context/media/usage/artifact/trace
validators stay local; src/subagent/diagnostics.ts folds into
validation.ts as hasSubagentErrors.

Legacy cleanup (exit-plan item 4):
- remove the src/subagent-contract.ts compatibility barrel; the package
  root re-exports subagent/contract.ts directly
- remove scripts/subagent-sdk-spike*, its test, and the spike:subagent
  npm script; media/trusted-extension coverage debt is recorded in
  NEXT_STEPS.md and returns with productized delegated media tasks
- drop the redundant takeReport re-sanitization (both backends sanitize
  at the source; the tool keeps its retention-boundary pass) and the
  local error/isRecord helper duplicates
- align SUBAGENT_ADAPTER_CONTRACT.md, SUBAGENT_INTERFACE_DESIGN.md,
  SUBAGENT_SDK_SPIKE_FINDINGS.md, FEATURES.md, PUBLIC_API.md, and
  NEXT_STEPS.md with the migrated architecture; CHANGELOG records the
  removed exports as breaking changes

npm run verify passes: 169 core tests, browser tests, typecheck,
generated-client, dist, and package checks.
Prompt blocks, runtime slots, and structured slot options now render
through a lifecycle-managed Vue component. Form and raw-JSON modes
share one reactive draft, preserve unknown option keys, and keep
malformed JSON visible while preventing validation, preview, or save.
The editor create/save APIs now reject a second auto-activation
profile with 409 instead of writing an ambiguous configuration,
matching the existing validation diagnostic.

Browser coverage now exercises the single auto-activation rule,
registry-populated model datalists, and runtime drift reporting
after external model, thinking-level, and stack changes.
Each profile now has a delegation card reporting its effective
delegation state, backend, timeout, and sources. Trusted projects can
toggle the subagents.profiles.<id> opt-in with backend and timeout
overrides without hand-editing .pi/forge/config.json; writes preserve
unrelated config keys and remove emptied entries. The card warns about
unregistered backends, marks enabled profiles with a subagent badge,
and keeps project defaults and the unattended-invocation setting
read-only. Backend listing degrades to registered IDs when backend
construction is unavailable so profile browsing never depends on
backend runtime resources.
The Vue app shell mount had no height, so the percentage-height chain
collapsed to content height while body clipped the overflow: the
delegation card, profile sidebar, and stacks workspace were silently
cut off with no scroll path. Both surfaces now use flex min-height:0
chains with internal scroll regions instead of magic-number calc()
heights, and the narrow profiles layout stacks without phantom gaps.

Also: default-select the last-applied or first healthy profile, mark
the delegation card's saved policy versus unsaved drafts, bound the
timeout override input, warn inline on unauthenticated models, add
aria-current to surface navigation, keep harness tests hermetic from
the developer's global config, and add a browser regression test that
asserts both surfaces stay within the viewport with reachable
bottom-of-page controls.
At widths up to 900px the workspace stayed a stretched single-column
grid, so the items pane row absorbed the window's leftover height as
dead space between the item list and the item editor. The narrow
workspace now lays out in normal block flow: the item list keeps its
260px internal scroll cap and the editor follows immediately after.
In the narrow stacked workspace the fill-height chain collapsed, so
the prompt-content textarea shrank to two lines while the fixed 128px
diagnostics region wasted space below it. The content editor now keeps
a 220px minimum height with vertical resize and item fields lay out in
two columns at narrow widths.

The diagnostics panel is now a collapsible summary header at all
widths: it auto-expands when errors or warnings exist, collapses to a
slim bar when clean, remembers an explicit user toggle, and exposes
aria-expanded state. Browser coverage exercises the automatic and
manual states.
… 2 landed

README and README.zh-CN now cover profile UI workflows (navigation,
badges, create/edit/validate/apply/delete, single auto-activation,
registry-driven controls, provenance/drift) and delegation consent
through the editor card alongside the config-file path. NEXT_STEPS
marks Milestone 2 complete.
@MacroSony
MacroSony merged commit cfe720d into main Aug 2, 2026
8 of 9 checks passed
@MacroSony
MacroSony deleted the feature/0.4-subagents-prep branch August 2, 2026 14:42
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.

1 participant