fix(mail): clarify that file path flags only accept relative paths#141
Conversation
Greptile SummaryThis PR clarifies that The enforcement was already in place before this PR: Key changes:
Confidence Score: 5/5Safe to merge — purely a documentation clarification with no logic changes; enforcement was already present via validate.SafeInputPath. All 6 shortcuts and all 6 reference docs are consistently updated. The "relative path only" constraint is real and already enforced at runtime. No new logic is introduced and no existing validation is weakened. The fix directly addresses the reported problem of AI models passing absolute paths. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[AI model invokes mail shortcut] --> B{Flag type}
B -->|--attach| C["Flag Desc now says 'relative path only'"]
B -->|--inline file_path| D["Flag Desc now says 'relative path only'"]
B -->|--patch-file| E["Flag Desc now says 'Relative path only.'"]
C --> F[splitByComma → bld.AddFileAttachment]
D --> G[parseInlineSpecs → bld.AddFileInline]
E --> H[loadPatchFile → validate.SafeInputPath]
F --> I[emlbuilder.readFile → validate.SafeInputPath]
G --> I
H --> I
I -->|Absolute path| J["❌ Error: must be a relative path within the current directory"]
I -->|Relative path| K["✅ File read succeeds — EML built and draft created"]
Reviews (1): Last reviewed commit: "fix(mail): clarify that file path flags ..." | Re-trigger Greptile |
…paths (larksuite#141)" This reverts commit 1ffe870.
… paths (larksuite#141)" This reverts commit d465e08.
* Revert "fix(mail): clarify that file path flags only accept relative paths (#141)" This reverts commit 1ffe870. * Revert "feat(mail): auto-resolve local image paths in draft body HTML (#81) (#139)" This reverts commit 70c72a2. * Reapply "fix(mail): clarify that file path flags only accept relative paths (#141)" This reverts commit d465e08.
* Revert "fix(mail): clarify that file path flags only accept relative paths (#141)" This reverts commit eac6fa9. * Revert "feat(mail): auto-resolve local image paths in draft body HTML (#81) (#139)" This reverts commit 22cc882. * Reapply "fix(mail): clarify that file path flags only accept relative paths (#141)" This reverts commit d465e08.
Summary
Update --attach, --inline, and --patch-file flag descriptions across all mail shortcuts and reference docs to explicitly state that only relative paths are accepted, fixing the issue where AI models would pass absolute paths (e.g.
/tmp/patch.json) when using lark-cli mail commands.Changes
Descin 6 shortcut Go files (draft-create, draft-edit, send, reply, reply-all, forward) to mention "relative path only"buildDraftEditPatchTemplate()shape descriptions and notes to reflect relative path constraint/tmp/patch.jsonexamples with./patch.jsonTest Plan
make unit-testpassed