iOfficeAI / iOfficeAI/AionCore
cron: automatic trigger omits timestamp in conversation title (run-now includes it)
- Dominant language
- Rust
- Stars
- 105
- Forks
- 169
- Avg merge
- 5h 58m
- Merged PRs (30d)
- 84
Description
## Summary
When a cron (scheduled) task fires and creates a new conversation, the generated conversation title should include the trigger timestamp. Currently:
- **Manual trigger** ("Run now") → the new conversation title **includes** the time.
- **Automatic trigger** (scheduler fires at the scheduled time) → the title **does not include** the time.
The two trigger paths produce inconsistent conversation titles.
Reported by a user via AionUi in-app feedback (AionUi @ 2.1.37, bundled AionCore v0.1.27).
## Root cause (from investigation on the AionUi side)
This is a backend divergence in the `aionui-cron` crate — the AionUi TypeScript layers never compose the cron conversation title, they only display it (title comes from the backend and is stored in `cron_jobs.conversation_title`).
There appear to be **two independent "create new conversation for cron job" code sites** that each build the title on their own, rather than sharing one helper:
- **Run-now path** — `aionui-cron/src/routes.rs`, the `/api/cron/jobs/{id}/run` handler. This branch builds the title **and appends the trigger timestamp**.
- **Scheduler tick path** — `aionui-cron/src/scheduler.rs` / `executor.rs`. This branch builds the title on its own and **does not append the timestamp** (appears to use the raw job name / `conversation_title` only).
Both branches log `Created new conversation for cron job`, but only the run-now branch runs the timestamp-append step.
## Suggested fix
Factor the new-conversation title construction (including the timestamp-append step) into a **single shared helper**, and have both the run-now handler and the scheduler tick call it, so automatic and manual triggers produce identical titles.
## Notes
- Not reproducible/fixable from the AionUi (`packages/desktop`) repo — the fix must land in this crate and ship in a rebuilt `aioncore` binary.
- Low severity (cosmetic title inconsistency), but it's a user-visible inconsistency between the two trigger modes.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in aionui-cron/src/routes.rs at the /api/cron/jobs/{id}/run handler, then compare its title construction with the scheduler path in aionui-cron/src/scheduler.rs and executor.rs. Factor the timestamp-inclusive construction into one shared helper and use it from both trigger paths. Done means automatic and manual cron runs create conversations with identical timestamped titles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100