Repository navigation
fix(context): Support subagent and BTW context inspection - #3993
Merged
Merged
Conversation
Keep launch tool definitions visible in fresh and reused child sessions, matching forked sessions. Enforce delegation policy when tools run while preserving transient session restrictions. Verify child preparation, visible tool definitions, and runtime denial with six focused unit tests.
Allow native subagent sessions to use on-demand context estimates while retaining explicit unsupported states for external and ephemeral agents. Cover fresh, reused, forked, and unloaded children, read-only inspection, preview consistency, legacy snapshots, and remote rule isolation. Validation: 12 focused tests passed with agent-runtime, git, and remote-workspace enabled.
Keep context preview queries and identities bound to the selected child while opening their tabs in the visible conversation canvas. Preserve asynchronous canvas ownership, device activation fences, and separate previews for sibling sessions. Validation: 155 focused tests and check:web passed. Remote coverage uses simulated SSH and Peer surfaces.
Read temporary context, turn metadata, prompt caches, and listing baselines from their in-memory owners without creating session files. Allow parent-owned BTW sessions to estimate context while retaining the unsupported state for internal workers with execution-only restrictions. Keep live memory inspection independent from unrelated durable recovery records while preserving workspace ownership validation. Validation: 17 focused tests passed with remote-workspace enabled, and the i18n audit passed. Remote coverage uses simulated workspaces.
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
AgentSpawnandAgentForkdefinitions visible in fresh and reused children, matching forks, while enforcing delegation policy when tools run.Type and Areas
Type: Bug fix / regression fix
Areas: Rust core session/runtime inspection; desktop/shared Web UI composer and context previews.
Motivation / Impact
Selecting a subagent or BTW conversation in the composer previously produced an unsupported context estimate. After native subagent estimates became available, clicking a category could still appear to do nothing because its preview was stored in the hidden child canvas.
Users can now inspect the selected child's current context and open its read-only category details in the visible sidebar. BTW remains memory-only, including during live turns and after compression. Inspection neither starts model execution nor restores or rewrites the session.
Verification
Passed 23 focused Rust tests, covering fresh/reused/forked children, runtime delegation denial, BTW memory ownership, previews, compression, legacy snapshots, workspace identity, and existing revert/fork behavior:
cargo test --locked -p openbitfun-core --no-default-features \ --features agent-runtime,git,remote-workspace --lib -- \ current_context_estimate context_composition \ visible_launch_tools_reject_nested_subagent_delegation \ fresh_subagent_inherits_matching_parent_worktree_binding \ fresh_subagent_inherits_transient_parent_persistence_boundary \ reused_subagent_send_input_updates_requested_and_inherited_model \ reused_subagent_legacy_smart_keeps_target_until_explicit_model_replacement \ fork_subagent_request_allows_requested_model_override \ btw_session_is_ephemeral_and_seeds_forked_listing_baselines \ session_fork_reconciles_pending_revert_and_rejects_hidden_explicit_turns \ session_fork_uses_verified_remote_storage_and_preserves_execution_identity \ sdk_usage_provider_validates_ids_and_keeps_live_token_enrichmentPassed 155 frontend DOM/store tests, including all preview categories, parent canvas routing, sibling isolation, delayed responses, and device activation fences (run from
src/web-ui):Also passed:
Reviewer Notes
Checklist