Skip to content

fix(cron): infer session agentId when omitted - #72326

Merged
vincentkoc merged 2 commits into
mainfrom
clownfish/ghcrawl-165998-agentic-merge
Apr 28, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
clownfish/ghcrawl-165998-agentic-merge

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Apr 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Validation

  • Testbox tbx_01kq9pv088bj28t13dx688yads: pnpm docs:list
  • Testbox tbx_01kq9pv088bj28t13dx688yads: pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/tools/cron-tool.ts src/agents/tools/cron-tool.test.ts src/cron/isolated-agent/delivery-target.ts src/cron/isolated-agent/delivery-target.test.ts
  • Testbox tbx_01kq9pv088bj28t13dx688yads: pnpm test:serial src/agents/tools/cron-tool.test.ts src/cron/isolated-agent/delivery-target.test.ts
  • Testbox tbx_01kq9pv088bj28t13dx688yads: pnpm check:changed

Notes

ProjectClownfish replacement details:

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Apr 26, 2026
@greptile-apps

greptile-apps Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the cron.add path in cron-tool.ts so that a job with agentId explicitly set to undefined is treated the same as a job where agentId is absent, triggering session-agent inference in both cases. Two focused regression tests cover the omitted and explicitly-undefined cases.

Confidence Score: 5/5

Safe to merge — narrow guard fix with targeted regression tests and no side effects on the null or explicit-string cases.

Change is a single-line guard expansion with clear intent, correct semantics (undefined != null, so explicit null still bypasses inference), and two new tests that directly cover the fixed paths. No other logic is touched.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(cron): infer session agentId when om..." | Re-trigger Greptile

@vincentkoc vincentkoc added the clawsweeper Tracked by ClawSweeper automation label Apr 27, 2026
@vincentkoc
vincentkoc force-pushed the clownfish/ghcrawl-165998-agentic-merge branch from b4f94ef to 8fb1582 Compare April 27, 2026 05:03
@vincentkoc
vincentkoc force-pushed the clownfish/ghcrawl-165998-agentic-merge branch from 8fb1582 to 47c6070 Compare April 27, 2026 06:04
@vincentkoc vincentkoc self-assigned this Apr 28, 2026
@vincentkoc
vincentkoc force-pushed the clownfish/ghcrawl-165998-agentic-merge branch from 47c6070 to 52a7845 Compare April 28, 2026 09:38
@vincentkoc

Copy link
Copy Markdown
Member Author

Aisle follow-up is fixed in 52a7845.

Evidence:

  • src/cron/isolated-agent/delivery-target.ts now catches provider normalization/parser exceptions in normalizeTargetForThreadCarry() and treats them as a non-match, so a malformed target cannot carry a stale threadId or abort cron delivery.
  • The final outbound target resolver path now catches thrown plugin target-resolution errors and returns a controlled ok: false delivery error instead of bubbling an exception out of cron delivery processing.
  • src/cron/isolated-agent/delivery-target.test.ts has regression coverage for both cases.

Testbox tbx_01kq9pv088bj28t13dx688yads:

  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/tools/cron-tool.ts src/agents/tools/cron-tool.test.ts src/cron/isolated-agent/delivery-target.ts src/cron/isolated-agent/delivery-target.test.ts passed.
  • pnpm test:serial src/agents/tools/cron-tool.test.ts src/cron/isolated-agent/delivery-target.test.ts passed.
  • pnpm check:changed passed.

@clawsweeper

clawsweeper Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

Keep this PR open. It is authored by a repository member and has the protected maintainer label, so this cleanup workflow must not auto-close it. Current main also does not contain the PR's cron agentId guard fix or its delivery-target hardening/tests, so it remains active implementation work rather than obsolete cleanup.

Best possible solution:

Keep the PR open for maintainer review. The likely best outcome is to land the session-agent inference guard and regression tests, while verifying the delivery-target hardening from 52a784513f7bcdb086ddcabc4dc7565bf45b460b preserves Telegram thread routing and converts plugin target-resolution failures into safe non-matches or controlled delivery errors.

What I checked:

  • Protected maintainer PR: Live GitHub issue metadata shows this PR is open, author_association is MEMBER, and labels include maintainer; the cleanup policy requires these items to stay open for explicit maintainer judgment.
  • Current main still misses the cron guard fix: The current cron.add path only infers a session agent when the agentId key is absent. An explicit agentId: undefined still bypasses inference on main. (src/agents/tools/cron-tool.ts:665, 058b57867e8c)
  • Current tests do not cover the PR's regression cases: Main has the agentId: null preservation test, but no omitted/explicit-undefined session-agent inference tests matching this PR's stated fix. (src/agents/tools/cron-tool.test.ts:251, 058b57867e8c)
  • PR diff contains the intended focused fix and tests: The PR head changes the guard to treat missing or undefined agentId as eligible for session inference and adds two cron-tool regression tests for omitted and explicit-undefined agentId. (src/agents/tools/cron-tool.ts:662, 52a784513f7b)
  • Security review pass: The diff touches only CHANGELOG.md, cron source, and focused tests. It does not change workflows, dependency sources, lockfiles, install/build/release scripts, package publishing metadata, or secrets handling. The security-relevant part is runtime error handling around plugin-provided target parsing/normalization, with regression tests in the PR diff for thrown target resolution and failed Telegram target normalization. (src/cron/isolated-agent/delivery-target.ts:43, 52a784513f7b)
  • Related contributor work is carried forward: The PR body explicitly carries forward fix(cron): auto-fill agentId from session when not explicitly provided #40571 and credits ChanningYul for identifying the agentId: undefined guard bug and focused regression coverage. fix(cron): auto-fill agentId from session when not explicitly provided #40571 is closed unmerged, so this PR is the active replacement rather than a duplicate to close. (52a784513f7b)

Remaining risk / open question:

  • The delivery-target changes execute plugin-provided target normalization/parsing in a cron delivery path. The PR now catches those failures, but maintainers should still review that the new non-match behavior preserves Telegram topic delivery without hiding actionable plugin bugs.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 058b57867e8c.

@vincentkoc
vincentkoc merged commit ae63f76 into main Apr 28, 2026
124 of 135 checks passed
@vincentkoc
vincentkoc deleted the clownfish/ghcrawl-165998-agentic-merge branch April 28, 2026 09:47
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* fix(cron): infer session agentId when omitted

* fix(clownfish): address review for ghcrawl-165998-agentic-merge (1)
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
* fix(cron): infer session agentId when omitted

* fix(clownfish): address review for ghcrawl-165998-agentic-merge (1)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(cron): infer session agentId when omitted

* fix(clownfish): address review for ghcrawl-165998-agentic-merge (1)
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix(cron): infer session agentId when omitted

* fix(clownfish): address review for ghcrawl-165998-agentic-merge (1)
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix(cron): infer session agentId when omitted

* fix(clownfish): address review for ghcrawl-165998-agentic-merge (1)
vixco pushed a commit to vixco/openclaw that referenced this pull request Aug 16, 2026
* fix(cron): infer session agentId when omitted

* fix(clownfish): address review for ghcrawl-165998-agentic-merge (1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper Tracked by ClawSweeper automation maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant