Repository navigation
feat(agent): add fork delegation and subagent model settings - #3978
Merged
Merged
Conversation
wsp1911
force-pushed
the
dev-pc
branch
2 times, most recently
from
November 17, 2026 12:13
e4465c9 to
26e1ad6
Compare
Add a default-enabled configuration setting and execution settings toggle. Hide model selection parameters and guidance when disabled, and enforce the execution host policy before collaboration calls run. Refresh tool specifications when the policy changes and negotiate peer support. Cover configuration compatibility, tool catalogs, execution checks, and settings behavior.
- Add AgentFork for background delegation with inherited context. - Preserve the parent tool definitions for fork prompt-cache reuse and enforce delegation policy when a launch tool is called. - Expose the fork default model in execution settings and track fork runs across chat, CLI, and remote surfaces.
Box collaboration policy inputs before constructing async state so nested catalog scopes cannot multiply large futures on the stack. Keep manual compaction preparation behind a heap allocation boundary. Preserve lazy policy loading and nested presentation snapshots. Add regression coverage for future size, scope inheritance, and cleanup, and document focused verification with the default thread stack. Validation: 16 focused PTC-enabled Rust tests pass after probe removal; the Rust CI configuration contract passes. Ubuntu CI passed with the same production fixes before removing temporary diagnostics.
Capture core test output and exact Cargo artifacts on Linux, macOS, and Windows. Diagnose stack overflows with bounded isolated reruns, platform debugger traces, and a larger-stack comparison while keeping the original test result as the CI gate. Reuse existing binaries without extra builds or Rust test runs on successful CI paths. Preserve evidence when a test cannot be identified or a debugger is unavailable, and clean up timed-out process trees. Add platform contract tests and document artifact use and limitations. Validation: 26 diagnostic tests, focused CI assertions, and YAML checks pass. A native Windows fixture verifies real stack-overflow detection, large-stack recovery, and process-tree cleanup. Native debugger traces remain to be validated on their respective hosts. The full GitHub configuration suite still has unrelated local shell-environment failures.
This was referenced Nov 18, 2026
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
AgentForkfor background delegation with inherited conversation context and expose its default model under Settings → Execution & Collaboration → Subagents.Type and Areas
Type: Feature, refactor
Areas: Rust agent runtime and tools, Web UI settings and chat, CLI, Peer Device, Remote Connect, mobile web, HarmonyOS, docs and locales
Motivation / Impact
Agents can delegate work that depends on the current conversation while keeping the default model under user control. Forked agents retain the parent tool definitions for first-request prompt-cache reuse. The runtime still checks delegation permission when a launch tool is called.
Verification
Passed before rebase:
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git --lib -- fork_subagent_request_allows_requested_model_override call_impl_rejects_nested_subagent_delegation(2 tests)pnpm --dir src/web-ui run test:run src/app/scenes/settings/pages/shared/RuntimeSettings.test.tsx src/app/scenes/settings/settingsRegistry.test.ts src/infrastructure/config/services/modelSelections.test.ts src/infrastructure/config/components/common/SettingsControlSizing.test.ts(64 tests, including simulated legacy Peer configuration)pnpm run check:webandpnpm run i18n:auditPassed after rebase:
pnpm run capabilities:checkandpnpm run capabilities:test(16 tests)git diff --check HEAD~3..HEADandnode scripts/check-git-object-sizes.mjs --base HEAD~3 --head HEADReviewer Notes
AI-assisted, lightly tested with focused local checks. Live remote scenarios, provider cache hits, and native UI visuals were not exercised. The model override setting remains enabled by default for existing installations. Model pool selection uses the existing host capability, and legacy peers use the existing single-model configuration path.
Checklist