Skip to content

fix(engine): key replay lookups by the served model#16

Open
flobernd wants to merge 1 commit into
profile-routingfrom
replay-served-model
Open

fix(engine): key replay lookups by the served model#16
flobernd wants to merge 1 commit into
profile-routingfrom
replay-served-model

Conversation

@flobernd

Copy link
Copy Markdown
Owner

Summary

The replay-cache lookup now keys by the served model, matching the insert side. Profiles that set upstream_model previously never got a replay hit because the lookup hashed the request model while the insert hashed the served model.

Testing

Full cargo test green (0 failed across all binaries), cargo fmt --check clean, cargo clippy --all-targets zero warnings. New wire test routes a web-search replay through a profile with upstream_model set and asserts the turn-2 tool result is reconstructed from replay (RED before the fix: the lookup missed and the placeholder text appeared instead). Catch-all profiles are unaffected since their served model equals the request model.

Closes local-inference-lab#32.

Notes

Stacked on local-inference-lab#36's branch; retarget or rebase once that merges.

The replay LOOKUP hashed on request.model (the raw client-facing
alias), while the INSERT (via hash_visible_history in run_turn) hashes
on served_model (the profile's resolved upstream_model). For any
profile that sets upstream_model, request.model never equals
served_model, so the two hashes disagree on every turn and a
follow-up request never finds the prior turn's baseline.

find_replay_baseline now takes the caller's already-resolved
served_model and hashes on that instead of re-deriving it, keeping
resolve_request_model the single resolution point. Catch-all profiles
are unaffected since their served model already equals the request
model.

Closes local-inference-lab#32
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.

1 participant