Files
cursor-byok/server/migrations/0003_run_cursor_request_id.sql
T
leookun 847e92c7ea 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.
2026-08-26 01:46:30 +08:00

7 lines
313 B
SQL

-- Cursor may reuse one transport request id for multiple queued executions.
-- Keep that id as an association key while each local Run keeps its own identity.
ALTER TABLE runs ADD COLUMN cursor_request_id TEXT;
CREATE INDEX idx_runs_cursor_request_active
ON runs(cursor_request_id, status, created_at_ms DESC);