mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-05 04:07:36 +08:00
refactor: update cursor request handling and improve parent request management
- Changed `run_id` to `request_id` in `CursorParent` struct for clarity. - Enhanced the `prepare` function to handle parent requests asynchronously, ensuring proper error handling for active runs. - Updated database interactions to include `cursor_request_id` for better tracking of requests. - Added tests to verify the behavior of reused cursor request IDs and their mapping to distinct executions.
This commit is contained in:
@@ -169,8 +169,16 @@ async fn eligible_pending_checkpoint_resumes_tools_before_the_next_model_call()
|
||||
1,
|
||||
"resume must execute the pending batch before calling the model"
|
||||
);
|
||||
let resumed_run_id = store
|
||||
.active_run_for_cursor_request("resumed-run")
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
let resumed_round = store
|
||||
.tool_round(&ToolRoundId::new("resumed-run:round:resume"))
|
||||
.tool_round(&ToolRoundId::new(format!(
|
||||
"{}:round:resume",
|
||||
resumed_run_id.as_str()
|
||||
)))
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user