← Back to PRs

#22609: feat(cron): add directText flag for text message dilivery and historyLimit flag

by bydsky open 2026-02-21 11:20 View on GitHub →
app: web-ui gateway cli agents size: S
## Summary - Problem: add direct-text flag to deliver text message directly - Why it matters: For text-only results, cron uses the subagent announce flow to deliver a user-facing update rather than raw output. This path intentionally asks the main agent to “convert the result into your normal assistant voice”, which tends to summarize. - What changed: add direct-text flag to deliver text message directly, skip subagent announce flow - What did NOT change (scope boundary): ## AI-assisted - Prompt: add a flag to delivers text payloads directly without the announce conversion path ## Change Type (select all) - [ ] Bug fix - [x ] Feature - [ ] Refactor - [ ] Docs - [ ] Security hardening - [ ] Chore/infra ## Scope (select all touched areas) - [x ] Gateway / orchestration - [ ] Skills / tool execution - [ ] Auth / tokens - [ ] Memory / storage - [ ] Integrations - [ ] API / contracts - [ ] UI / DX - [ ] CI/CD / infra ## Security Impact (required) - New permissions/capabilities? (`No`) - Secrets/tokens handling changed? (`No`) - New/changed network calls? (`No`) - Command/tool execution surface changed? (`No`) - Data access scope changed? (`No`) - If any `Yes`, explain risk + mitigation: ## Human Verification (required) What you personally verified (not just CI), and how: - Verified scenarios: - Edge cases checked: - What you did **not** verify: ## Compatibility / Migration - Backward compatible? (`No`) - Config/env changes? (`Yes`) - Migration needed? (`No`) ## Human Verification (required) - Verified scenarios: set direct-text to true; set history-limit to 0; - Edge cases checked: Yes <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR adds two new features to cron jobs: a `directText` delivery flag to bypass the announce conversion path for text-only payloads, and a `historyLimit` parameter to control conversation history retention per job (0 = unlimited). **Major changes:** - Added `directText` boolean field to `CronDelivery` type and schema, with CLI flags `--direct-text` in both `cron add` and `cron edit` commands - Added `historyLimit` number field to `CronJob` type and schema, with CLI flag `--history-limit <n>` supporting 0 for unlimited history - Updated delivery routing logic in `src/cron/isolated-agent/run.ts:635` to respect `directText` flag - Threaded `historyTurnLimit` parameter through the embedded agent runner stack to support per-job history limits - Renamed `getDmHistoryLimitFromSessionKey` to `getHistoryLimitFromSessionKey` (kept deprecated alias) **Issues found:** - Critical logic error in `src/agents/pi-embedded-runner/history.ts:19` breaks documented behavior for `historyLimit=0` (should mean unlimited, but will actually limit to 0 turns) - Unrelated change to `src/agents/system-prompt.ts` removes `isMinimal` guard for skills section, changing minimal prompt behavior without explanation - PR title contains typo: "dilivery" should be "delivery" <h3>Confidence Score: 1/5</h3> - This PR is unsafe to merge due to a critical logic error that breaks documented behavior - Score of 1 reflects a critical logic bug in `history.ts` that violates the documented contract (`historyLimit=0` should mean unlimited) and will cause existing tests to fail. The implementation adds valuable functionality but the history limiting logic must be fixed before merge. - Pay special attention to `src/agents/pi-embedded-runner/history.ts` (critical logic error) and `src/agents/system-prompt.ts` (unrelated behavioral change needs justification) <sub>Last reviewed commit: c1ef5f8</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs