Skip to content

fix(models): preserve runtime-specific context selection - #168809

Closed
RomneyDa wants to merge 2 commits into
stack/copilot-context-reporting-20261010from
stack/copilot-context-selection-20261010
Closed

RomneyDa wants to merge 2 commits into
stack/copilot-context-reporting-20261010from
stack/copilot-context-selection-20261010

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Problem and solution

Model changes and session forks could borrow capacity from the wrong runtime, while live/static catalog copying dropped declared context-window choices. Preserve the catalog declarations and carry the selected runtime, route and window into the existing budget owner. CLI and fallback candidates use their actual runtime rows; directives retain their abort and post-await authority checks.

This is a 25-file selection layer above reporting #165991. Memory flushing and cron accounting remain separate. Authored configuration continues to use its existing schema; catalog window choices are declaration metadata.

Validation

Actual-parent controls reproduced lost discovery choices (19 pass, one fail) and incorrect fork capacity (nine pass, two fail). After the repair, 175 distinct cases across ten whole suites pass. The initial composite took 293.06 seconds and preserved six CLI integration failures; the corrected caller was rerun with its affected suites in 167.02 seconds.

Production types, all 28 native test-type graphs, selected lint and the required ratchets passed on the reviewed input. Fresh complete P0–P3 review has no findings (confidence .84). All remaining planned guards pass. The native dead-export scan remains red for inherited Gateway/UI exports and the interim authored resolver; 17 relevant declaration/caller/scan-owner blobs match the actual parent and the independent cron parent. No ignore or aggregate-green claim is used.

Published head 8faf58056b8 integrates actual reporting ce1b2a783cf without conflicts. All 25 owned postimages match the reviewed selection input. Current production types (13.04s), five consuming test-type graphs (agents-other, gateway-root, plugins-platform, messaging, other), scoped lint, formatting, and diff checks pass. Earlier 175-case results remain unchanged-source evidence, not a current-head replay. Current CI retains two inherited failures: the Solid JSX import-analysis error before assertions, and canonical-descendant binding initialization. For the latter, tested merge 25bbc71cb64 combines reporting ce1b2a783cf with this head; all 18 traced fixture/adoption/binding/cache owners are byte-identical on incorporated main 3f97b146a5a, the actual parent, and this head. Test cleanup physically deletes plugin-state rows without publishing tombstones, so later cases reuse a stale cached binding and fail before fork-budget selection. This is source-causal attribution, not an independently executed main baseline or a passing CI claim.

Do not merge yet: final integrated Windows/Copilot, Windows-node interoperability and Telegram proof are pending. Prior installed core proof is prior-package evidence. Auto-merge stays disabled.

@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review October 11, 2026 01:47
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Preserves catalog window choices and uses runtime-specific capacity for model selection, directives, CLI attempts, and session forks.

Example: Fork an openai/fork-capacity-fixture session using Codex when only its API catalog advertises 1,000,000 tokens.

  • Before: Fork sizing can borrow the API runtime's 1,000,000-token capacity.
  • After: Native capacity remains unknown instead of borrowing the API limit.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, coherent repair with focused owner coverage and no identified introduced defect; integrated runtime confidence remains limited.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate is exempt for this maintainer-authored PR; inspected media demonstrates the earlier picker feature, and prior-package observations do not validate the integrated selection repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Model changes and forks can use another runtime's context capacity, while discovered models lose their selectable windows.
Reason: Source supports the defects, feature history establishes runtime isolation, and maintainer authorship settles the repair direction.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it repairs source-evidenced defects still present on main, and no concrete introduced bug was found; the author's explicit merge hold remains active.

Priority: P2
Reviewed head: 8faf58056b897e0798b6ce3aa30884f8191923c6

Before merge

  • Complete next step - Have the author release the explicit do-not-merge hold and have CI owners classify the failed shards with baseline evidence or an attributable repair before landing.

Findings

None.

Tests

  • Missing end-to-end proof: Integrated Windows/Copilot, Windows-node, and Telegram observations of model changes, fork sizing, and retained window choices remain pending under the author's hold.
Agent review details

How this fits together

Provider catalogs supply model, route, runtime, and window metadata to selection callers, which pass qualified facts into the existing context-budget owner.

flowchart TD
 A[Provider catalogs] --> B[Prepared catalog owner]
 B --> C[Runtime selection]
 C --> D[Context budget owner]
 D --> E[Directives and model pickers]
 D --> F[CLI attempts]
 D --> G[Session forks]
Loading

Technical review

Best possible solution:

Land the selection repair in dependency order after the explicit hold is released and failed CI gates receive a supported disposition.

Do we have a high-confidence way to reproduce the issue?

Current-main source exposes dropped discovery choices and native fork sizing that can consume API capacity; the author reports failing actual-parent controls, but this read-only review ran no reproduction.

Is this the best way to solve the issue?

Preserving declarations at their projection boundary and passing runtime-qualified facts into the existing budget owner addresses the causes without adding a competing capacity registry.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c6d71fae0ed1.

Provenance checked

  • Runtime-specific capabilities and fork limits keeps the original intent (b46c38c: Offer one logical model through distinct harnesses while preserving each harness's capabilities and fork capacity.)
  • Catalog window-choice metadata keeps the original intent (78373d4: Preserve catalog choices for equivalent routes without lending them across different endpoints or APIs.)
  • Provider catalog projection keeps the original intent (296cd8c: Isolate unreadable plugin-owned rows so healthy provider and model siblings remain available.)
  • Mixed directive persistence keeps the original intent (2e9d4de: Apply mixed directives through one authoritative transaction with commit-time model-lock checks.)
  • Shared session model application keeps the original intent (f0e81b9: Centralize model, runtime, account, conflict, and persistence behavior for interactive pickers.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b46c38c adds src/agents/model-catalog-view.ts:47 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b46c38cfa732; files: src/agents/model-catalog-view.ts)
  • Ayaan Zaidi: Raw commit 78373d4 adds src/plugins/provider-catalog.ts:210 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 78373d43f621; files: src/plugins/provider-catalog.ts)

PR surface

Source +130, Tests +693, Docs +5. Total +828 across 25 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 14 210 80 +130
Tests 10 748 55 +693
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 25 963 135 +828

Review metrics

Metric Value Why it matters
Production versus test LOC Production +210/-80; tests +748/-55 Production growth carries runtime-qualified facts through existing owners; tests cover distinct discovery, selection, directive, CLI, and fork consumers.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Incorrect capacity affects model changes and forks with mixed runtime catalogs, with limited blast radius.
  • merge-risk: 🚨 compatibility: The plugin catalog-result contract now retains two optional window-choice fields; maintainer authorship settles direction and released format support establishes compatibility.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Changed directive selection supplies context facts visible through Telegram context and status commands.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach integrated runtime results showing model changes, fork sizing, and preserved selectable windows.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-11T01:54:13.012Z sha b49a48a :: needs changes before merge. :: none
  • reviewed 2026-10-11T03:08:33.800Z sha 8faf580 :: needs changes before merge. :: none

Reviewed October 10, 2026, 11:28 PM ET / October 11, 2026, 03:28 UTC (Revision 3).

@steipete

Copy link
Copy Markdown
Contributor

Thanks @RomneyDa. The still-needed part of this landed in #169792, with you credited as co-author: native context forks no longer borrow API context capacity, and an oversized native fork is rejected instead of exceeding the native window. It's a +2/-2 change verified with before/after runs plus local and native controls. The broader reporting changes here depended on APIs that main has since replaced, so the replacement kept only the fix. Closing as superseded.

@steipete steipete closed this Oct 12, 2026
@RomneyDa
RomneyDa deleted the stack/copilot-context-selection-20261010 branch October 22, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants