Skip to content

fix(#96): [bug] --model on a can_orchestrate entry silently strips the delegate tool - #106

Open
7487 wants to merge 2 commits into
Jason-Vaughan:mainfrom
7487:fix/issue-96-bug-model-on-a-can-orchestrate-entry-sil
Open

fix(#96): [bug] --model on a can_orchestrate entry silently strips the delegate tool#106
7487 wants to merge 2 commits into
Jason-Vaughan:mainfrom
7487:fix/issue-96-bug-model-on-a-can-orchestrate-entry-sil

Conversation

@7487

@7487 7487 commented Aug 17, 2026

Copy link
Copy Markdown

Summary

Fixes #96[bug] --model on a can_orchestrate entry silently strips the delegate tool
Source issue: #96

Spec

Spec - Issue #96: [bug] --model on a can_orchestrate entry silently strips the delegate tool

Source: #96

Problem

Pinning an orchestrator-capable roster entry with --model builds the adapter without delegate
injection, so the same backend can delegate through the router path but silently becomes a leaf when
explicitly selected. The streaming path has the same direct adapter build and needs the same fix.

Acceptance criteria

  • run_once(..., model=<orchestrator>) builds the selected adapter with inject_delegate=True.
  • run_once_stream(..., model=<orchestrator>) keeps the same delegate injection behavior.
  • Existing local, gate-local, router, and paid API guard behavior stays covered by the suite.

Approach

Use the selected entry's existing can_orchestrate flag when building an explicit --model
adapter. This keeps leaf entries inert and matches the router's delegate-enabled orchestrator path
without adding another CLI flag or config field.

Files likely touched

  • tanglebrain/cli.py - direct model adapter construction.
  • tests/test_cli.py - regression coverage for blocking and streaming model paths.
  • CHANGELOG.md - unreleased bug-fix note.
  • docs/design/api-contract.md - remove the stale known-defect entry.
  • docs/design/operations.md - remove the stale workaround.

Risk / blast radius

  • Scope: small
  • Breaking: no
  • Migration needed: no

Test plan

  • Unit: targeted unittest for the two new regression cases; full make test.
  • Integration: project hermetic suite via make test.
  • Visual: not applicable; no UI change.

Out of scope

  • Adding a --no-delegate opt-out flag.
  • Changing delegate target selection or recursive delegation rules.

Work breakdown (TDD)

TODO - Issue #96

Setup

  • Read full issue body and repository contributing guidance.
  • Run make test on clean branch to confirm baseline is green.
  • Identify direct adapter builds in tanglebrain/cli.py and sibling streaming path.

TDD loop

  • Red 1 - Add regression tests for blocking and streaming --model orchestrator paths.
  • Green 1 - Pass entry.can_orchestrate into the direct adapter build.
  • Refactor 1 - No refactor needed; smallest working change is two call-site arguments.

Verification

  • Targeted regression tests pass.
  • make test passes.
  • Self-review diff: no debug prints, no commented-out code, no unrelated changes.

Wrap-up

  • create-pr.sh to push + open PR.
  • Paste PR URL into recap memo.

Visual verification

No screenshots captured (stub or non-UI change).

Blockers / open questions

Test plan

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Manual smoke on the affected surface (see screenshots)

Generated by the auto-github-contributor skill. The agent followed a red-green-refactor loop and captured visual artefacts under .auto-pr/screenshots/.

@7487

7487 commented Aug 28, 2026

Copy link
Copy Markdown
Author

Updated the branch against main (clean merge) — full test suite passes locally (480 passed, 17 skipped). Happy to adjust anything if needed.

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.

[bug] --model on a can_orchestrate entry silently strips the delegate tool

1 participant