Skip to content

multi-model-delegation: PAL attachment budgets + the curated-excerpt-bundle pattern #2120

Description

@laurigates

What

Enhancement for agent-patterns-plugin:multi-model-delegation from a 3-provider consult that worked exceptionally well (2026-07-19, loractl #132 — the identical-brief split correctly located the load-bearing question, and code adjudication settled it). Three PAL mechanics the skill doesn't carry bit during dispatch; all three were solved with one pattern worth encoding.

The mechanics that bit

  1. Per-model attachment token budgets. absolute_file_paths is capped at ~60% of context headroom, and the cap varies wildly by model: observed gpt-5.3-codex limit 76,800 tokens but kimi-k2.7-code only 28,311 (262K context). A 7-file attachment set (~84K tokens) bounced on BOTH — the skill's 'pass code via absolute_file_paths' advice needs the caveat that multi-file briefs routinely exceed the smallest model's budget, and the identical-briefs invariant then forces trimming for ALL models.
  2. working_directory_absolute_path must live inside PAL_WORKSPACE_ROOT. A scratchpad path outside the repo is rejected (must reside within the PAL workspace root). Use <repo>/tmp/ instead.
  3. (Already partially covered) gemini-3-pro-preview got retired upstream mid-registry (404 → resend identical brief to the provider's current frontier alias) — the skill's registry-retirement guidance held up. And the pal#68 metadata scrambling got a new datum: three CONCURRENT chat calls returned model_used values rotated across each other while provider_used stayed request-consistent (fix(chat): response metadata reports wrong model_used for OpenAI-routed requests pal-mcp-server#68 comment) — worth strengthening the skill's 'verify independence via provider_used' note to 'under concurrency, model_used is untrustworthy'.

The pattern to encode

Curated excerpt bundle: build ONE markdown file inside the workspace (<repo>/tmp/<consult>/context-excerpts.md) with §-numbered verbatim excerpts of exactly the load-bearing regions (each section titled with its real file path + line range), sized under the smallest target model's budget; attach that single file to every model and reference sections (§1–§11) from the brief. This preserved the identical-brief invariant, fit all three budgets (~21K tokens), and models cited sections accurately.

Suggested edits

  • 'PAL Mechanics That Bite': add the budget table row (limits are per-model, threshold ~60%, kimi ≈ 28K observed), the workspace-root restriction, and the concurrency caveat on model_used.
  • New subsection or table row for the excerpt-bundle pattern with the sizing rule ('smallest model's budget bounds the bundle').

Evidence: loractl#132 (the consult that produced ADR-0005 Addendum 2), loractl/tmp/pal-consult/context-excerpts.md structure, pal-mcp-server#68 comment (concurrency datum).

🤖 Generated with Claude Code

https://claude.ai/code/session_0135LFtd7ffxSCEuy3nVZGxc

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions