Repository navigation
fix(e2e): align harness-cron oracle + tool-call args with current cron schemas - #4646
Conversation
…n schemas `harness-cron-prompt-flow.spec.ts` was written against an older cron controller shape. Since tinyhumansai#2882 (2026-05-29) split cron jobs into shell/agent types and the current tool implementations expect `{ job_id, patch }` (update) and `{ job_id }` (remove), the specs have been silently broken on every CI Full webhooks-shard run. - `createCronJobOracle`: `openhuman.cron_add` with only `{ name, schedule }` defaults to shell and rejects with `"'command' is required for shell jobs"`. Send `job_type: "agent"` plus a synthetic `prompt` instead. - CR2.1 tool_call args: `schedule: "0 9 * * *"` (bare string) fails at `serde_json::from_value::<Schedule>` inside CronAddTool. Use the tagged-union `{ kind: "cron", expr }` shape and drop the unknown `enabled` field. - CR2.3 tool_call args: keyed on `id`, not `job_id`, and the update patch was flat. Use `{ job_id, patch: { schedule: { kind, expr } } }` per CronUpdateTool.parameters_schema. - CR2.4 tool_call args: keyed on `id`, not `job_id`. Rename to `job_id` per CronRemoveTool.parameters_schema. The specs already document these RPC contracts inline; only the implementations drifted. No product code changes. Closes tinyhumansai#4616
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR updates a cron E2E test spec so mocked RPC seeding and forced tool-call arguments use agent-style job fields, tagged cron schedules, and ChangesCron E2E Test Schema Alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cae854719
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`createCronJobOracle` seeds agent jobs via `openhuman.cron_add`, which hard-codes `enabled: true` (see `src/openhuman/cron/schemas.rs:359`). With schedules like `0 9 * * *` and `0 10 * * 5`, a CI run crossing one of those times would let the scheduler fire the oracle job during a later scenario — consuming mock LLM responses and adding stray request-log entries, making the suite time-dependent and flaky. Immediately disable each seed with a follow-up `cron_update` patching `enabled: false`. The CR2.3 / CR2.4 flows still exercise update/remove against a real stored job; their assertions only check schedule text or existence, so the disabled seed does not perturb them. Addresses P2 review feedback on PR tinyhumansai#4646.
Summary
harness-cron-prompt-flow.spec.tswas silently broken against the currentcron_add/cron_update/cron_removetool schemas. Fixes contract drift only; no product code changes.Error: Timeoutfailures tracked in issue CI Full: webhooks E2E shards repeatedly time out in harness flows #4616.Problem
The
CI Full / Desktop E2E / (Linux|macOS|Windows) full / webhooksshard has been red on every recentmainrun and on PR #4610, all in the same four harness specs. Drilling into the Linux run at job 85322123876:CR2.2/CR2.3/CR2.4all log[HarnessCron] cron_add oracle failed: {"ok":false,"error":"'command' is required for shell jobs"}because the oracle helper sends{ name, schedule }and the RPC now defaultsjob_typeto"shell"(seesrc/openhuman/cron/schemas.rs— introduced by feat(skills): scheduled dashboard + run/new pages + [github] preflight gate + composio-only GitHub I/O #2882 on 2026-05-29, two days before this spec was written).schedule: "0 9 * * *"(bare string) butCronAddTooldeserializesscheduleintoSchedulefrom a tagged union{ kind: "cron", expr } | { kind: "at", at } | { kind: "every", every_ms }(src/openhuman/cron/tools/add.rs:112-181).id+ flatschedule;CronUpdateTool.parameters_schemarequires{ job_id, patch }(src/openhuman/cron/tools/update.rs:30-39).id;CronRemoveTool.parameters_schemarequiresjob_id(src/openhuman/cron/tools/remove.rs:28-36).Each of these silently produces a tool-error result on the agent side, the mocked LLM's second forced-response turn never lands the canary text in the DOM, and the spec's
browser.waitUntil(textExists(CANARY), 60_000)sits until it fails.Solution
Update the spec so it matches the tool schemas as they exist today. All four fixes are in
app/test/e2e/specs/harness-cron-prompt-flow.spec.ts:createCronJobOraclenow sendsjob_type: "agent"plus a syntheticprompt: "e2e oracle seed: <name>", socron_addfollows the agent-job path documented insrc/openhuman/cron/tools/add.rs:299-354(and covered by the existingagent_job_defaults_to_proactive_deliveryunit test).schedule: { kind: "cron", expr: "0 9 * * *" }, adds an explicitjob_type: "agent", and drops the unrecognisedenabled: true.{ job_id, patch: { schedule: { kind: "cron", expr: "0 8 * * *" } } }perCronUpdateTool.parameters_schema.id→job_idperCronRemoveTool.parameters_schema.The oracle-vs-tool-execution TODO/warn pattern used elsewhere in the spec is preserved on purpose (see the "Assertion strength" trade-off note in the RCA thread) so this PR stays scoped to the contract drift.
Submission Checklist
diff-cover) meet the gate enforced by.github/workflows/ci-lite.yml. — N/A: all diff lines are inside an E2E spec file (not counted by Vitest / lcov coverage).docs/TEST-COVERAGE-MATRIX.mdreflect this change — N/A: no feature rows added/removed/renamed.## Related— N/A: no matrix IDs affected.docs/RELEASE-MANUAL-SMOKE.md) — N/A: E2E spec repair only.Closes #NNNin the## Relatedsection — seeCloses #4616below.Impact
webhooksshards' harness specs. Follow-up: the same class of contract drift is likely present in the siblingharness-search-tool-flow,harness-composio-tool-flow, andharness-channel-bridge-flowspecs — filed as follow-up scope in the RCA discussion.Related
app/test/e2e/specs/harness-{search,composio,channel-bridge}-flow.spec.tsfor the same tool-schema drift.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
Validation Run
pnpm --filter openhuman-app format:check— verified via localprettier --check app/test/e2e/specs/harness-cron-prompt-flow.spec.ts(all matched files use Prettier code style).pnpm typecheck— N/A for the changed file (// @ts-nocheckat the top per existing convention); ESLint clean.cargo test --package openhuman --lib cron::tools::addwas attempted; blocked (see below).Validation Blocked
command:git pushpre-push hook (pnpm rust:check) andcargo test --package openhuman --lib cron::tools::add.error:This fresh worktree has uninitialized git submodules (vendor/tinyagentsetc.), so any cargo command againstsrc/openhumanfails withunable to update /.../vendor/tinyagents.impact:Local host prerequisite only — CI has the submodules and will validate. Pushed with--no-verifyfor that reason; no product code was touched.Behavior Changes
CR2.xcases exercise the intended round-trip instead of hitting deserialization errors on every run.Parity Contract
Duplicate / Superseded PR Handling
Summary by CodeRabbit