feat(p5): NL → /agents bg intent-gate workflow#141
Merged
Conversation
Add a `background` workflow kind to the intent-gate so users can launch background agents via natural language (e.g., "scout this repo in background" triggers /agents bg scout <task>). Files: - intent-gate.ts: background workflow kind + bg-launch GateDecision - bg-args.ts: --profile parsing (mirrors --backend first-token pattern) - bg-preflight.ts: profileOverride accepted + project trust stashed - bg-state.ts: BgRunManifest.options.profile field - bg-worker.ts: library reconstruction (user + trusted-project + built-ins) + projectTrusted/projectRegistry threaded to runChildAgent - index.ts: gate handler bg-launch branch + __bgLaunchTestHook seam - test-intent-gate.mjs: 3 new tests (config, classification, confirm) - test-bg-args.mjs: --profile parser tests - test-bg-worker.mjs: production-path library reconstruction + project profile trust wiring tests - examples/intent-workflows-with-background.json: sample config Security: TUI confirm before bg launch (REQ-SEC-3), disableContextFiles (REQ-SEC-5), session profileLibrary + deliverResult re-attach (REQ-7), profile passed structurally not via string interpolation. Reviewed by codex (gpt-5.5 high) via cmux — approve after 4 rounds
lantiscooperdev
approved these changes
Jul 4, 2026
lantiscooperdev
pushed a commit
that referenced
this pull request
Jul 4, 2026
… (#142) Post-merge sync for P5 NL → /agents bg intent-gate workflow (PR #141, commit 6d61802). Also catches up P5b-2 zellij-terminal (PR #139) which had skipped its workplan-sync docs commit. - WORKPLAN.md: chain head now 20260704-122521-...-d94b (was stale at the P5E1 head 20260704-083722-...-64a1) - P3_IMPLEMENTATION_SLICES.md: add P5b-2 zellij-terminal section (catch-up) + P5 NL→bg intent-gate section with the 4-round codex review trail and the multi-layer profile pathway lesson Co-authored-by: Charlton D. Ho <dev@znp.pw>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
backgroundworkflow kind to the intent-gate so users can launch background agents via natural language (e.g., "scout this repo in background" triggers/agents bg scout <task>).Changes
intent-gate.ts:backgroundworkflow kind +bg-launchGateDecision variants.classifyGateIntentreturnsbg-launchwith agent + task + profile, defaulting agent to"scout".bg-args.ts:--profile <name>parsing mirroring the--backendfirst-token pattern.bg-preflight.ts:profileOverrideaccepted; project trust stashed into manifest so the worker can reconstruct the library.bg-state.ts:BgRunManifest.options.profilefield added.bg-worker.ts: profile library reconstruction (user~/.pi/agent/profiles+ trusted-project.pi/profiles+ built-ins) — same sources assession_start.projectTrusted+projectRegistrythreaded torunChildAgentso project-source profiles pass the trust gate end-to-end.index.ts: gate handlerbg-launchbranch +__bgLaunchTestHooktest seam (mirrors__gateDispatch). TUI confirm shows "Launch in background ${agent}?";disableContextFiles, sessionprofileLibrary/deliverResultre-attach, profile resolution all preserved.--profileparser tests, worker library-reconstruction + project profile trust-wiring tests.agents/examples/intent-workflows-with-background.jsonsample config.Security
disableContextFilesset for bg path (REQ-SEC-5)Test results
Review
Reviewed by codex (gpt-5.5 high) via cmux — 4 review rounds: changes-requested (profile dropped → row library reconruction → project-profile trust gate) → approve-with-nits → approve. No blockers, no non-blocking concerns remaining.