Skip to content

Agents/media: restore agent-scoped and iMessage attachment roots#39034

Closed
vincentkoc wants to merge 10 commits into
mainfrom
vincentkoc-code/fix-media-roots-36185-30170
Closed

Agents/media: restore agent-scoped and iMessage attachment roots#39034
vincentkoc wants to merge 10 commits into
mainfrom
vincentkoc-code/fix-media-roots-36185-30170

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

  • Problem: the message tool dropped agent-scoped media roots for runs without an agentSessionKey, and the image tool could not read iMessage attachments after 2026.2.26 because attachmentRoots never reached its local allowlist.
  • Why it matters: cron/hook sessions could not send workspace files, and iMessage attachments that passed channel validation still failed image-tool local path checks.
  • What changed: forward an explicit/default agent id into the message tool path, merge iMessage attachment roots into agent-scoped media roots, use those roots in the image tool, and honor wildcard local roots during local media validation.
  • What did NOT change (scope boundary): no new media directories were exposed beyond the existing agent workspace and configured iMessage attachment roots.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

  • Cron/hook-style agent runs can send files from the configured agent workspace again.
  • The image tool can read iMessage attachment paths allowed by configured attachmentRoots, including wildcard roots such as /Users/*/Library/Messages/Attachments.
  • CHANGELOG.md now includes entries for both fixes with thanks to @ravz, @macminikenny1, and @vincentkoc.

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

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local pnpm workspace
  • Model/provider: MiniMax image tool test fixture
  • Integration/channel: message tool + iMessage attachment roots
  • Relevant config (redacted): agent workspace override, channels.imessage.attachmentRoots

Steps

  1. Configure an agent workspace outside the default OpenClaw media roots and run a cron/hook-style send without an agentSessionKey.
  2. Configure iMessage attachmentRoots, send an attachment, and use the image tool on that local path.
  3. Validate local media loading against a wildcard root such as /tmp/*/Library/Messages/Attachments.

Expected

  • Workspace files are accepted by the message tool.
  • iMessage attachments are accepted by the image tool.
  • Wildcard local roots match local attachment paths.

Actual

  • Before this change, workspace files failed with path-not-allowed, iMessage attachments were rejected by the image tool, and wildcard local roots never matched.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: targeted regression tests for message-tool agent resolution, image-tool iMessage attachment access, merged media roots, and wildcard local root validation.
  • Edge cases checked: explicit agent override without session key, preserved workspace-only fs policy, wildcard root matching through the shared media loader.
  • What I did not verify: end-to-end sends against a live iMessage account or a live cron/hook deployment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert the commits touching message-tool, image-tool, local-roots, and web/media.
  • Files/config to restore: src/agents/tools/message-tool.ts, src/agents/openclaw-tools.ts, src/agents/tools/image-tool.ts, src/media/local-roots.ts, src/web/media.ts
  • Known bad symptoms reviewers should watch for: unexpected local media allowlist expansions outside configured workspaces or iMessage attachment roots.

Risks and Mitigations

  • Risk: wildcard local-root handling could over-match if non-iMessage patterns are malformed.
    • Mitigation: matching reuses the existing inbound path wildcard policy and keeps explicit-root behavior unchanged.

@vincentkoc vincentkoc self-assigned this Mar 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: whatsapp-web Channel integration: whatsapp-web agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Mar 7, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review March 7, 2026 17:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56b5340a72

ℹ️ 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".

Comment thread src/media/local-roots.ts
agentId?: string,
): readonly string[] {
const roots = buildMediaLocalRoots(resolveStateDir());
for (const attachmentRoot of resolveIMessageAttachmentRoots({ cfg })) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include per-account iMessage roots in media allowlist

getAgentScopedMediaLocalRoots now merges iMessage roots via resolveIMessageAttachmentRoots({ cfg }), but this call omits accountId, so channels.imessage.accounts.<id>.attachmentRoots are never included. For setups that define attachment directories only at the account level (and not globally), image/message local-path validation still fails with path-not-allowed, so iMessage attachment handling remains broken for those accounts despite this fix.

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restores two broken media-access paths: agent-scoped workspace roots for cron/hook sessions in the message tool, and iMessage attachment roots for the image tool. The fixes are targeted and well-tested.

Verified findings:

  1. Scope boundary concern: getAgentScopedMediaLocalRoots unconditionally merges DEFAULT_IMESSAGE_ATTACHMENT_ROOTS even when iMessage is not configured, which silently expands the local media allowlist beyond the PR's stated scope of "configured iMessage attachment roots" only.

  2. Test coverage gap: No regression test exists for the zero-argument fallback path where neither agentId nor agentSessionKey are provided, even though this is the exact scenario the PR fixes for cron/hook sessions.

  3. Inconsistent agent-ID resolution: The image-tool path uses nullish coalescing (??) while message-tool uses logical OR (.trim() ||), causing different behavior if requesterAgentIdOverride is set to empty string.

The core bug fixes (message-tool agentId fallback and wildcard local-root matching) are correct and address real regressions, but these three issues warrant attention before merging.

Confidence Score: 3/5

  • Safe to merge with caution — the bug fixes are correct and well-tested, but three issues require attention: unconditional DEFAULT_IMESSAGE_ATTACHMENT_ROOTS inclusion expands scope, a regression test gap exists, and agent-ID resolution is inconsistent between tools.
  • The two core fixes (message-tool agentId resolution for cron/hook sessions and wildcard local-root matching) are correct and backed by targeted tests. However, all three identified issues are verified: (1) a scope expansion beyond what the PR claims, (2) missing test coverage for the zero-argument fallback path being fixed, and (3) inconsistent empty-string handling that could cause subtle bugs. These are not showstoppers but warrant addressing before merging.
  • src/media/local-roots.ts — unconditional DEFAULT_IMESSAGE_ATTACHMENT_ROOTS merge should be gated on iMessage being configured; src/agents/tools/message-tool.ts — missing regression test for zero-argument agent-ID fallback; src/agents/openclaw-tools.ts — inconsistent empty-string handling between image-tool and message-tool paths.

Last reviewed commit: 56b5340

Comment thread src/media/local-roots.ts
Comment on lines 44 to +49
const roots = buildMediaLocalRoots(resolveStateDir());
for (const attachmentRoot of resolveIMessageAttachmentRoots({ cfg })) {
if (!roots.includes(attachmentRoot)) {
roots.push(attachmentRoot);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEFAULT_IMESSAGE_ATTACHMENT_ROOTS unconditionally broadened

resolveIMessageAttachmentRoots always appends DEFAULT_IMESSAGE_ATTACHMENT_ROOTS (/Users/*/Library/Messages/Attachments) regardless of whether iMessage is configured in cfg. This means every call to getAgentScopedMediaLocalRoots — including from image-tool runs in deployments that do not use iMessage at all — will include that default wildcard root in the local-media allowlist.

The PR description states: "no new media directories were exposed beyond the existing agent workspace and configured iMessage attachment roots", but DEFAULT_IMESSAGE_ATTACHMENT_ROOTS is not a user-configured root; it is a hard-coded default. On macOS this path exists for any local user account, silently expanding the allowlist without explicit opt-in.

Consider gating the default roots on iMessage actually being configured:

Suggested change
const roots = buildMediaLocalRoots(resolveStateDir());
for (const attachmentRoot of resolveIMessageAttachmentRoots({ cfg })) {
if (!roots.includes(attachmentRoot)) {
roots.push(attachmentRoot);
}
}
const iMessageRoots =
cfg.channels?.imessage
? resolveIMessageAttachmentRoots({ cfg })
: [];
for (const attachmentRoot of iMessageRoots) {
if (!roots.includes(attachmentRoot)) {
roots.push(attachmentRoot);
}
}

This still fixes the parity bug for configured iMessage deployments while preserving the previous security boundary for non-iMessage deployments.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/media/local-roots.ts
Line: 44-49

Comment:
**DEFAULT_IMESSAGE_ATTACHMENT_ROOTS unconditionally broadened**

`resolveIMessageAttachmentRoots` always appends `DEFAULT_IMESSAGE_ATTACHMENT_ROOTS` (`/Users/*/Library/Messages/Attachments`) regardless of whether iMessage is configured in `cfg`. This means every call to `getAgentScopedMediaLocalRoots` — including from image-tool runs in deployments that do not use iMessage at all — will include that default wildcard root in the local-media allowlist.

The PR description states: *"no new media directories were exposed beyond the existing agent workspace and configured iMessage attachment roots"*, but `DEFAULT_IMESSAGE_ATTACHMENT_ROOTS` is not a user-configured root; it is a hard-coded default. On macOS this path exists for any local user account, silently expanding the allowlist without explicit opt-in.

Consider gating the default roots on iMessage actually being configured:

```suggestion
const iMessageRoots =
  cfg.channels?.imessage
    ? resolveIMessageAttachmentRoots({ cfg })
    : [];

for (const attachmentRoot of iMessageRoots) {
  if (!roots.includes(attachmentRoot)) {
    roots.push(attachmentRoot);
  }
}
```

This still fixes the parity bug for configured iMessage deployments while preserving the previous security boundary for non-iMessage deployments.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +779 to +781
agentId:
options?.agentId?.trim() ||
resolveSessionAgentId({ sessionKey: options?.agentSessionKey, config: cfg }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test for zero-argument fallback to default agent ID

The new test at line 120 covers the agentId: "cron-agent" explicit-override case. However, there is no test for the new behavior when both agentId and agentSessionKey are absent: the code now resolves to a default agent ID instead of undefined. Adding a test for this path would prevent a silent regression if the fallback logic is ever changed:

Suggested change
agentId:
options?.agentId?.trim() ||
resolveSessionAgentId({ sessionKey: options?.agentSessionKey, config: cfg }),
it("falls back to default agent ID when neither agentId nor sessionKey is provided", async () => {
mockSendResult();
const tool = createMessageTool({ config: {} as never });
await tool.execute("1", { action: "send", target: "telegram:123", message: "hi" });
const call = mocks.runMessageAction.mock.calls[0]?.[0];
expect(call?.agentId).toBeDefined();
expect(call?.sessionKey).toBeUndefined();
});
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/tools/message-tool.ts
Line: 779-781

Comment:
**Missing test for zero-argument fallback to default agent ID**

The new test at line 120 covers the `agentId: "cron-agent"` explicit-override case. However, there is no test for the new behavior when *both* `agentId` and `agentSessionKey` are absent: the code now resolves to a default agent ID instead of `undefined`. Adding a test for this path would prevent a silent regression if the fallback logic is ever changed:

```suggestion
it("falls back to default agent ID when neither agentId nor sessionKey is provided", async () => {
  mockSendResult();
  const tool = createMessageTool({ config: {} as never });
  await tool.execute("1", { action: "send", target: "telegram:123", message: "hi" });
  const call = mocks.runMessageAction.mock.calls[0]?.[0];
  expect(call?.agentId).toBeDefined();
  expect(call?.sessionKey).toBeUndefined();
});
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +83 to +88
agentId:
options?.requesterAgentIdOverride ??
resolveSessionAgentId({
sessionKey: options?.agentSessionKey,
config: options?.config,
}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent empty-string handling vs message-tool

The image-tool path uses nullish coalescing (??) on line 84, so an empty-string requesterAgentIdOverride is forwarded as-is. The message-tool path (line 780 in message-tool.ts) explicitly uses .trim() || (logical OR), so an empty override string falls through to resolveSessionAgentId.

If requesterAgentIdOverride is ever set to "" by a misconfigured caller, the two tools would resolve agentId differently. Consider aligning to use .trim() || for consistency with the message-tool pattern.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/openclaw-tools.ts
Line: 83-88

Comment:
**Inconsistent empty-string handling vs message-tool**

The image-tool path uses nullish coalescing (`??`) on line 84, so an empty-string `requesterAgentIdOverride` is forwarded as-is. The message-tool path (line 780 in `message-tool.ts`) explicitly uses `.trim() ||` (logical OR), so an empty override string falls through to `resolveSessionAgentId`.

If `requesterAgentIdOverride` is ever set to `""` by a misconfigured caller, the two tools would resolve `agentId` differently. Consider aligning to use `.trim() ||` for consistency with the message-tool pattern.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge.

Latest ClawSweeper review: 2026-05-24 04:13 UTC / May 24, 2026, 12:13 AM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

PR Surface
Source +29, Tests +125, Docs +2. Total +156 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 5 35 6 +29
Tests 4 125 0 +125
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 162 6 +156

Summary
The branch threads agent IDs into media tools, merges iMessage attachment roots into agent-scoped local media roots, adds wildcard local-root checks, and adds regression tests plus changelog entries.

Reproducibility: yes. by source inspection: current main still gives the image tool default/workspace roots only, while the PR-side root merge omits accountId and always pulls in default iMessage roots. I did not run a live iMessage or cron/hook flow in this read-only review.

PR rating
Overall: 🧂 unranked krab
Proof: 🌊 off-meta tidepool
Patch quality: 🧂 unranked krab
Summary: The PR targets valid regressions, but unresolved security-boundary, account-root, and current-main conflict issues make the patch not quality-ready.

Rank-up moves:

  • Rebase onto current main's media loader paths and resolve the conflicting branch state.
  • Use an account-aware iMessage/channel media-root contract and add regression coverage for account-only roots plus non-iMessage configs.
  • Keep current main's message-tool agent plumbing unless a refreshed diff proves another caller still drops requester context.
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Real behavior proof
Not applicable: The contributor proof gate is not applied because this is a maintainer-labeled member PR; the body reports targeted regression tests but no live iMessage or cron/hook run.

Risk before merge

  • Merging the branch as-is can broaden model-facing host-local reads to the default Messages attachment wildcard even for runs not scoped to configured iMessage attachment access.
  • Configured account-only iMessage attachment roots are not included by the proposed no-account resolver call, so those setups can still fail with path-not-allowed.
  • The branch is conflicting/dirty against current main and edits the removed src/web/media.ts path instead of the active src/media/web-media.ts and src/media/local-media-access.ts loader path.
  • Current main already has message-tool agent-context plumbing; a stale rebase could reintroduce drift in that path if not refreshed carefully.
  • Because the PR is maintainer-labeled, member-authored, and maintainerCanModify=false, it needs author or maintainer refresh rather than cleanup closure or autonomous repair.

Maintainer options:

  1. Refresh account-aware media roots (recommended)
    Rebase on current main and pass only configured, account-aware attachment roots through src/media/web-media.ts and src/media/local-media-access.ts.
  2. Approve broader Messages trust explicitly
    Maintainers could intentionally allow default Messages attachment roots globally, but that should be documented as a security decision and covered by non-iMessage plus account-root tests.
  3. Defer to configurable media roots
    If the narrow iMessage fix is no longer the desired shape, pause this branch and resolve the broader configurable media-root contract in Feature: configurable mediaLocalRoots for image tool #47856.

Next step before merge
Protected maintainer/member work with unresolved security-boundary findings, account-root correctness gaps, a dirty/conflicting branch, and maintainerCanModify=false needs maintainer or author refresh rather than an autonomous repair marker.

Security
Needs attention: The patch changes model-facing host-local media reads and can add default Messages attachment wildcard roots outside explicit configured-account context.

Review findings

  • [P1] Gate default iMessage roots before widening local reads — src/media/local-roots.ts:42-46
  • [P1] Carry account-scoped attachment roots into the allowlist — src/media/local-roots.ts:42-46
  • [P2] Port wildcard checks to the current media loader — src/web/media.ts:116-120
Review details

Best possible solution:

Refresh or replace the branch on current main with an account-aware, configured-root-only media access contract in the active media loader while preserving current main's message-tool agent plumbing.

Do we have a high-confidence way to reproduce the issue?

Yes by source inspection: current main still gives the image tool default/workspace roots only, while the PR-side root merge omits accountId and always pulls in default iMessage roots. I did not run a live iMessage or cron/hook flow in this read-only review.

Is this the best way to solve the issue?

No. The direction is valid, but the mergeable fix should be a current-main, account-aware, configured-root-only contract rather than globally adding default iMessage roots and patching the old loader path.

Label justifications:

  • P2: This is a real media-tool regression area with limited blast radius, but it needs normal maintainer review rather than emergency handling.
  • merge-risk: 🚨 message-delivery: The PR changes attachment/media allowlist behavior and still misses account-scoped iMessage roots, so valid attachment reads can continue to fail after merge.
  • merge-risk: 🚨 security-boundary: The PR changes which host-local paths model-facing tools may read, including a default Messages attachment wildcard outside explicit configured-account context.
  • rating: 🧂 unranked krab: Current PR rating is 🧂 unranked krab because proof is 🌊 off-meta tidepool, patch quality is 🧂 unranked krab, and The PR targets valid regressions, but unresolved security-boundary, account-root, and current-main conflict issues make the patch not quality-ready.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The contributor proof gate is not applied because this is a maintainer-labeled member PR; the body reports targeted regression tests but no live iMessage or cron/hook run.

Full review comments:

  • [P1] Gate default iMessage roots before widening local reads — src/media/local-roots.ts:42-46
    resolveIMessageAttachmentRoots always includes the default Messages attachment wildcard, and this new call runs for every agent-scoped media-root lookup. Non-iMessage or unconfigured runs would gain that host-local read root despite the PR's stated configured-root scope.
    Confidence: 0.93
  • [P1] Carry account-scoped attachment roots into the allowlist — src/media/local-roots.ts:42-46
    Calling the iMessage resolver without an accountId skips channels.imessage.accounts.<id>.attachmentRoots, so account-only iMessage setups can still reject valid attachments with path-not-allowed.
    Confidence: 0.91
  • [P2] Port wildcard checks to the current media loader — src/web/media.ts:116-120
    The wildcard allowance is added to src/web/media.ts, but current main now checks local media through src/media/web-media.ts and src/media/local-media-access.ts; after rebase this change must move to the active loader path.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.92

Security concerns:

  • [medium] Avoid broad default Messages attachment roots — src/media/local-roots.ts:42
    Adding resolveIMessageAttachmentRoots({ cfg }) to every agent-scoped root set can expose the default Messages attachment wildcard to image/media tools even when the run is not tied to configured iMessage attachment access.
    Confidence: 0.92

Acceptance criteria:

  • node scripts/run-vitest.mjs src/agents/tools/image-tool.test.ts src/media/local-roots.test.ts src/media/local-media-access.test.ts
  • node scripts/run-vitest.mjs src/agents/tools/message-tool.test.ts src/infra/outbound/message-action-runner.media.test.ts

What I checked:

  • protected-pr-state: Live PR metadata shows the maintainer label, mergeable=CONFLICTING, mergeStateStatus=DIRTY, maintainerCanModify=false, and head 56b5340; the provided GitHub context identifies the author association as MEMBER. (56b5340a72dd)
  • current-message-context: Current main already resolves sessionAgentId from requesterAgentIdOverride/session context and passes it into createMessageTool, so the message-tool agent-context part is already covered on main. (src/agents/openclaw-tools.ts:170, d0751111a472)
  • current-image-root-gap: Current main's image tool still builds localRoots through resolveMediaToolLocalRoots, whose implementation returns only default roots plus workspaceDir and does not inherit iMessage attachmentRoots. (src/agents/tools/image-tool.ts:765, d0751111a472)
  • current-agent-roots-contract: Current main's getAgentScopedMediaLocalRoots returns default roots plus a resolved agent workspace only; it has no channel attachment-root merge. (src/media/local-roots.ts:54, d0751111a472)
  • imessage-root-contract: The iMessage attachment root resolver accepts accountId and always merges DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, so the PR's no-account call can both miss account-only roots and add the default Messages wildcard outside explicit configured-account context. (extensions/imessage/src/media-contract.ts:7, d0751111a472)
  • obsolete-loader-path: Current main routes local media checks through src/media/web-media.ts and src/media/local-media-access.ts, while the PR patch edits src/web/media.ts; src/web currently contains only provider-runtime-shared files. (src/media/local-media-access.ts:32, d0751111a472)

Likely related people:

  • steipete: Recent GitHub path history shows repeated changes to image-tool and local-media access, including image compression, fs-safe/media reader refactors, and inbound media reference centralization. (role: recent area contributor; confidence: high; commits: 4c210e22fa97, 538605ff44d2, 4e9c83d4d8e5; files: src/agents/tools/image-tool.ts, src/media/local-media-access.ts, src/media/web-media.ts)
  • jacobtomlinson: GitHub path history ties media local-root policy changes to configurable/dynamic local-root work that directly overlaps the current allowlist boundary. (role: media-root policy contributor; confidence: medium; commits: 1ca4261d7e05, 824e16f9dddd; files: src/media/local-roots.ts)
  • vincentkoc: The PR author also appears in prior merged history touching iMessage/extension boundary work, so they are a plausible owner for refreshing this branch's iMessage media-root shape. (role: current proposer and adjacent imessage boundary contributor; confidence: medium; commits: 503b43f43f61, 56b5340a72dd; files: extensions/imessage/src/media-contract.ts, src/media/local-roots.ts, src/agents/tools/image-tool.ts)
  • shakkernerd: Recent image-tool history includes media tool availability and image auto-discovery changes that overlap the construction path this PR modifies. (role: adjacent image-tool runtime contributor; confidence: low; commits: 22e8d7b469ef, 1a6d89113233, 186b8e44dce2; files: src/agents/tools/image-tool.ts)

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

@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress.

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.
What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels May 22, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels May 22, 2026
@omarshahine

Copy link
Copy Markdown
Contributor

Closing this stale branch in favor of a fresh current-main fix.

Thanks @vincentkoc for identifying and proving the original media-root regressions here. I rechecked current main: the message-tool/agent-workspace half is now already fixed, but the iMessage image-tool attachment-root bug is still real. This PR is now conflicting and targets older media-loader paths, and the old approach would need security-sensitive account-aware root handling before it could land.

I'll open a new narrow PR that keeps the useful direction from this branch, fixes only the remaining current bug, and credits this work.

@omarshahine

Copy link
Copy Markdown
Contributor

Superseded by a fresh current-main fix for the remaining iMessage attachment-root bug.

@omarshahine

Copy link
Copy Markdown
Contributor

Replacement PR is open here: #86569.

Thanks again @vincentkoc. I carried forward the useful issue/root-cause direction from this PR, kept the fix scoped to the remaining current-main iMessage image-tool attachment-root bug, and added focused regression coverage plus changed-check proof there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: whatsapp-web Channel integration: whatsapp-web maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

2 participants