Feat: CXA-1831 Persist latest model and reasoning effort in sqlite#14859
Feat: CXA-1831 Persist latest model and reasoning effort in sqlite#14859shijie-oai merged 4 commits intomainfrom
Conversation
| ALTER TABLE threads ADD COLUMN model TEXT; | ||
| ALTER TABLE threads ADD COLUMN reasoning_effort TEXT; |
There was a problem hiding this comment.
Capture the latest model and reasoning effort per thread.
ced5beb to
8bb84a0
Compare
| impl FromStr for ReasoningEffort { | ||
| type Err = String; | ||
|
|
||
| fn from_str(s: &str) -> Result<Self, Self::Err> { | ||
| match s { | ||
| "none" => Ok(Self::None), | ||
| "minimal" => Ok(Self::Minimal), | ||
| "low" => Ok(Self::Low), | ||
| "medium" => Ok(Self::Medium), | ||
| "high" => Ok(Self::High), | ||
| "xhigh" => Ok(Self::XHigh), | ||
| _ => Err(format!("invalid reasoning_effort: {s}")), | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
A simple string to enum parser so that read from db can be correctly converted. Better to keep such parser on the enum def side so that we can reuse down the line.
| } | ||
|
|
||
| impl FromStr for ReasoningEffort { | ||
| type Err = String; |
There was a problem hiding this comment.
Generic string type error - open to have a custom error type if necessary but feel like an overkill.
8bb84a0 to
c992e04
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c992e04eaa
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE threads ADD COLUMN model TEXT; | |||
There was a problem hiding this comment.
@charley-oai if there is a migration here, maybe good to package yours in the same release
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn apply_rollout_items_without_turn_context_persists_null_model_and_reasoning_effort() { |
There was a problem hiding this comment.
the 3 tests in this file are a bit redundant. Can we merge them please?
We shouldn't have test for every combinatorial possibility and try to build smarter tests instead. The CI pipeline is already pretty slow
Summary
The goal is for us to get the latest turn model and reasoning effort on thread/resume is no override is provided on the thread/resume func call. This is the part 1 which we write the model and reasoning effort for a thread to the sqlite db and there will be a followup PR to consume the two new fields on thread/resume.
part 2 PR is currently WIP and this one can be merged independently.