Skip to content

fix(steering): one outcome per model switch even if it later becomes ineligible - #331

Merged
senamakel merged 1 commit into
mainfrom
harness-uplift/switch-model-once
Oct 7, 2026
Merged

senamakel merged 1 commit into
mainfrom
harness-uplift/switch-model-once

Conversation

@senamakel

Copy link
Copy Markdown
Member

This follow-up to #325 carries #325's last review fix. That fix was pushed after #325 merged, so it never reached main. It addresses the Codex P2 thread on #325.

Bug: a sticky SwitchModel could be reported as Steered { accepted: true } on one turn and then rejected on a later turn. That can happen when a stateful before_model middleware adds a capability requirement mid-run. The result was a second Steered outcome for one command.

Fix: SteeringHandle::reject_model_override now reports whether the switch was already announced. When it was, apply_steered_model_switch skips Steered { accepted: false } and still emits ModelOverrideSkipped.

Test: a_switch_that_becomes_ineligible_after_being_reported_keeps_one_outcome asserts the outcomes are exactly [true].

Checks: the model_switch and steering tests pass (64). Clippy (--all-features -D warnings) and fmt are clean.

Co-authored-by: Medulla medulla@tinyhumans.ai

… rejection

A model override that was already reported as applied could later be
rejected when the switched-to model turned out to be ineligible, emitting a
second contradictory Steered event for the same command. reject_model_override
now reports whether the override had been announced so the rejection path
skips the duplicate event, and a test covers the late-ineligibility case.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper

tinysweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Ready for maintainer review
Priority: none
Reviewed head: 4ea88ca8223c
Updated: 1791374192 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 2 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 3 files; 0 findings. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 3 files; 0 findings. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change prevents a second, contradictory `Steered { accepted: false }` event for a model switch already reported as applied, and the new test `a_switch_that_becomes_ineligible_after_being_reported_keeps_one_outcome` pins exactly that contract — it would fail if the guard regressed. The behavioural change and its test are aligned; safe to merge. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change fixes the double-outcome bug for a steered model switch that later becomes ineligible: `reject_model_override` now reports whether the switch was already announced, the rejection path skips the second `Steered` event while still emitting `ModelOverrideSkipped`, and a new test covers exactly this scenario. The description matches the diff, and the change looks sound. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: No end-to-end harness in this repository: no e2e test files and no e2e workflow.
Evidence and run details
  • Models: gpt-5.6-luna, glm-5.3-flash
  • Spend: $0.006482
  • Tokens: 133067 input · 5880 output · 14728 cached · 0 embedding
Head State Pass summary
4ea88ca8223c ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 1791374192)

tinysweeper 0.1.0

@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

Or wait 40 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c55b5e44-ce5a-4a6f-9e27-b6ba34f0b701
📥 Commits

Reviewing files that changed from the base of the PR and between 6168016 and 4ea88ca.

📒 Files selected for processing (3)
  • crates/tinyagents-harness/src/agent_loop/model_switch.rs
  • crates/tinyagents-harness/src/agent_loop/model_switch_tests.rs
  • crates/tinyagents-harness/src/steering/mod.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T11:57:34.404774Z 4ea88ca PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

             $0.0065 · 133,067 in / 5,880 out · 14,728 cached (11%) · gpt-5.6-luna, glm-5.3-flash
critique:    $0.0025 · 40,696 in  / 2,845 out · 4,240 cached (10%)  · gpt-5.6-luna
security:    $0.0039 · 79,199 in  / 1,527 out · 7,416 cached (9%)   · gpt-5.6-luna
tests:       $0.0000 · 5,003 in   / 148 out   · 1,536 cached (31%)  · glm-5.3-flash
description: $0.0000 · 4,607 in   / 116 out   · 1,408 cached (31%)  · glm-5.3-flash

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 7, 2026
@senamakel
senamakel merged commit c45cc44 into main Oct 7, 2026
17 checks passed
@senamakel
senamakel deleted the harness-uplift/switch-model-once branch October 7, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant