-
Notifications
You must be signed in to change notification settings - Fork 48
Cl 1935 scheduling workflows which run on a specific time #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
danyalxahid-askui
merged 17 commits into
main
from
CL-1935-scheduling-workflows-which-run-on-a-specific-time
Jan 7, 2026
Merged
Cl 1935 scheduling workflows which run on a specific time #217
danyalxahid-askui
merged 17 commits into
main
from
CL-1935-scheduling-workflows-which-run-on-a-specific-time
Jan 7, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…essage creation Enhanced the `create_message` method in `MessageService` to include an optional parameter `inject_cancelled_tool_results`. When set to `True`, it creates cancelled tool results if the parent message contains pending tool_use blocks. This change improves the handling of tool execution interruptions by providing relevant feedback in the message flow.
Changed the type of `tool_result_content` in the `create_message` method from `list[ToolResultBlockParam]` to `list[ContentBlockParam]` to ensure mypy compatability.
…uler Added functionality for managing scheduled jobs, including creation, listing, and cancellation. Introduced `ScheduledJobService` for handling job operations and integrated it into the FastAPI application. Updated the application to start and shutdown the scheduler during lifespan events. Added necessary models and dependencies for scheduled job data handling.
…eduled_jobs Eliminated the unused `query` parameter from the `list_scheduled_jobs` function in the router. Cleaned up imports in `scheduler.py` by removing type ignore comments for better clarity. Updated the `list_` method in `ScheduledJobService` to reflect the removal of the `query` parameter.
Added entries for SQLite shared memory and write-ahead logging files to `.gitignore`. Enhanced SQLite connection settings in `engine.py` by enabling WAL mode for concurrent access and setting a busy timeout to prevent database locking issues. Removed unused return type documentation in `executor.py` for clarity.
Refactored the `create` method in `ScheduledJob` to accept `params` of type `ScheduledJobCreate` instead of individual parameters. Updated the `create_scheduled_job` function in the router to pass `params` directly to the service. Cleaned up imports and removed unnecessary data construction in the router for improved clarity.
…e ScheduledJob creation Introduced a new `name` field in the `MessageRerunnerDataCreate` model to enhance the data structure. Updated the `ScheduledJob` creation process to include the `name` parameter from `params.data`, ensuring that the new field is properly utilized during job creation.
Updated the `execute_job` function to support the new `askui_token` field in `ScheduledJobData`. Implemented environment variable management for `ASKUI_TOKEN` and `AUTHORIZATION` headers to accommodate different authentication methods. Refactored the job execution logic to ensure proper handling of new job types and restore previous environment states after execution. Enhanced the `ScheduledJobCreate` model to include the `askui_token` parameter for authenticated API calls.
…te configuration, get around the write lock when scheduler and Runner wants to write to the same DB Introduced a new `scheduler_url` field in `DbSettings` for APScheduler job storage, allowing separate database management. Updated the `engine.py` to utilize the new scheduler database and removed unused SQLite connection settings. Enhanced the `scheduler.py` to create a dedicated engine for the scheduler database and ensure proper SQLite configuration for foreign key support. Updated logging to use a private logger for better encapsulation.
…r handling Refactored the `execute_job` function to utilize a new `_execute_message_rerunner_job` helper function for better clarity and separation of concerns. Updated the handling of `MessageRerunnerData` and improved error messages for better debugging. Removed unused imports and ensured proper type hints throughout the code. Enhanced the `ScheduledJob` model to streamline the extraction of `next_fire_time` and improved the handling of workspace validation in the `ScheduledJobService` class.
…ction for unauthorized issues after token expiry
…35-scheduling-workflows-which-run-on-a-specific-time
Updated the `execute_job` function to improve the handling of `askui_token` by utilizing `SecretStr` for better security. Refactored the logic to manage the `ASKUI__AUTHORIZATION` environment variable, ensuring proper encoding of the token. Enhanced the extraction of `next_fire_time` in the `ScheduledJob` model for clearer error handling. Updated the `ScheduledJobService` to pass the decoded token securely during job execution. This refactor aims to streamline job execution and improve overall code clarity.
…ecutionResult Modified the `execute_job` function to return a `ScheduledJobExecutionResult`, encapsulating job data and optional error messages. Enhanced error handling during job execution, ensuring that the previous `ASKUI__AUTHORIZATION` environment variable is restored after execution. Improved documentation for the function's parameters and return type to clarify its behavior and expected output.
onur-askui
reviewed
Jan 2, 2026
onur-askui
reviewed
Jan 2, 2026
onur-askui
reviewed
Jan 2, 2026
onur-askui
reviewed
Jan 2, 2026
onur-askui
reviewed
Jan 2, 2026
onur-askui
approved these changes
Jan 5, 2026
…database settings Refactored the `DbSettings` class to consolidate the database URL for SQLAlchemy connections, removing the separate `scheduler_url` field. Updated the database engine configuration in `engine.py` to utilize optimized SQLite pragmas for better performance and concurrency. Adjusted the `scheduler.py` to use the shared engine, ensuring that APScheduler operates with the same database settings. Enhanced the `.gitignore` to include SQLite shared memory and write-ahead logging files for improved project cleanliness.
Updated the `ScheduledJobService` to return a sorted list of scheduled jobs based on their `next_fire_time`. This change enhances the order of job execution, ensuring that jobs are processed in a timely manner.
onur-askui
approved these changes
Jan 5, 2026
Contributor
onur-askui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that we can use one db now [: 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Background Scheduling functionality implementation.
Includes: