Skip to content

docs(apps): restrict creative-mode wording in skill guidance - #2801

Merged
zhmushan merged 3 commits into
larksuite:mainfrom
yysbuge:fix/apps-export-share-link
Oct 12, 2026
Merged

zhmushan merged 3 commits into
larksuite:mainfrom
yysbuge:fix/apps-export-share-link

Conversation

@yysbuge

@yysbuge yysbuge commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Agents given only a Miaoda creative-app share link (/page/<token>) never reached lark-apps: the link sits on a Feishu domain and looks like a doc, so they routed it to lark-doc (then chased a docx:document:readonly scope) or to a browser. When +export was reached by a viewer without download permission, the gateway's HTTP 200 + {"code":40300} envelope surfaced as subtype unknown with no hint.

Changes

  • lark-apps description: state what a Miaoda app link looks like (/app/app_xxx, /page/<token>) next to the existing runtime domain.
  • lark-doc description: note that /page/<token> is a Miaoda app, not a Feishu cloud document.
  • lark-apps SKILL.md / lark-apps-export.md: route reading or summarizing an app's content to +export; a /page/ token goes straight to --meta-token without a +get detour; document the 40300 form of permission denial.
  • apps +export: re-type the 200+JSON 40300 envelope as the same authorization/permission_denied error the HTTP-403 branch raises (code, log_id, troubleshooter and cause kept). Command-scoped like 40901, since the spark code table is global.

Test Plan

  • Unit tests pass (go test ./shortcuts/apps/ ./internal/errclass/), incl. new TestAppsExport_TypesPermissionDeniedEnvelope (fails without the fix)
  • go vet, gofmt, skill format check, skill wire-vocab check
  • Manual verification in a test environment: +export --meta-token on a creative app returns a valid zip; a 40300 response now reports authorization/permission_denied with a hint (previously api/unknown)
  • Agent E2E with link-only prompts on the final skill wording (fresh sessions, neutral working directory):
    • /page/<token> + "summarize" → lark-apps, first command apps +export --meta-token, export succeeds and the agent summarizes the unzipped source
    • /app/app_xxx + "analyze" → lark-apps, first command apps +export --app-id, export succeeds
    • /docx/<token> + "summarize" → lark-doc, docs +fetch succeeds (not captured by lark-apps)
    • /page/<token> without download permission → lark-apps, apps +export returns permission_denied; the agent reports the missing permission to the user (it first tried a browser fallback before reporting)## Related Issues
  • None

yysbuge and others added 3 commits October 9, 2026 11:50
An agent handed a creative-mode share link (/page/<token>) and asked to read or
summarize it never reached +export: the lark-apps description did not mention
/page/ links or reading an app's content, and the SKILL.md app_id section told
it to resolve the token through +get first, which a share-link viewer cannot
pass. Name the link shape and the read intent in the description, and route
that intent straight to +export --meta-token.

When the viewer lacks download permission the gateway answers HTTP 200 +
{"code":40300,"msg":"permission denied"}, not a 403, so classifyExportErr's
403 branch never ran and the caller got subtype "unknown" with no hint.
Re-type that envelope as the same permission_denied error the 403 branch
raises, keeping code, log id, troubleshooter and cause. It stays command-scoped
like 40901: the spark code table is global and 40300 is too generic to claim.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Given only a /page/<token> share link and no mention of Miaoda, agents
routed it to lark-doc (the URL sits on a Feishu domain and looks like a
document) or to a browser, never reaching lark-apps.

lark-apps: restore the upstream description and state what a Miaoda app
link looks like (/app/app_xxx, /page/<token>) next to the existing runtime
domain, so the skill is chosen from the link alone.

lark-doc: note that /page/<token> is a Miaoda app, not a Feishu cloud
document, right after its path-based routing rule.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c5f56c5-cff3-4df0-a80f-90ac6b40df27


📥 Commits

Reviewing files that changed from the base of the PR and between cff1bda and 9fce4d3.



📒 Files selected for processing (5)
  • shortcuts/apps/apps_export.go
  • shortcuts/apps/apps_export_test.go
  • skills/lark-apps/SKILL.md
  • skills/lark-apps/references/lark-apps-export.md
  • skills/lark-doc/SKILL.md


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

妙搭应用导出指引现涵盖 /app/ 和 /page/ 链接。导出错误处理现将 HTTP 200 响应中的业务码 40300 识别为权限错误。

Changes

妙搭应用导出

Layer / File(s) Summary
链接识别与导出指引
skills/lark-apps/SKILL.md, skills/lark-apps/references/lark-apps-export.md, skills/lark-doc/SKILL.md
妙搭应用技能指引新增 /app/app_xxx 和 /page/<token> 链接识别。/page/ token 可直接用于 +export --meta-token,无需先解析为 app_id;其他命令仍需解析。lark-doc 说明 /page/ 链接不是飞书云文档。
导出权限错误处理
shortcuts/apps/apps_export.go, shortcuts/apps/apps_export_test.go, skills/lark-apps/references/lark-apps-export.md
HTTP 403 和 HTTP 200 JSON 信封中的业务码 40300 使用共享权限提示。40300 转换为权限错误,同时保留错误码、日志 ID、原因和故障排查器。测试验证错误类型、原因及未生成归档文件。文档补充分享 token 或页面访问权限不代表下载权限。

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: liangshuo-1, zhmushan



Merge Risk: ⚪ Minimal · up to 9fce4

This change routes Miaoda app links to the export command and reports permission denials from the export gateway more clearly. No merge-blocking risk was found. Test results were not supplied.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (3 skipped: 3 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title accurately refers to the skill-guidance changes, but it does not mention the main export routing and 40300 permission-error classification changes. It is still related to a real part of the …
Description check Passed The description includes all required sections: Summary, Changes, Test Plan, and Related Issues. It clearly explains the motivation, implementation changes, and verification results.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths labels Oct 9, 2026
@yysbuge yysbuge changed the title fix: 读取创意应用使用export命令 fix: reading miaoda creative app by export command Oct 9, 2026
@yysbuge yysbuge changed the title fix: reading miaoda creative app by export command docs(apps): restrict creative-mode wording in skill guidance Oct 10, 2026
@fangshuyu-768 fangshuyu-768 removed the domain/ccm PR touches the ccm domain label Oct 12, 2026
@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@9fce4d383ab0b331b47acd201130e0c97b88e625

🧩 Skill update

npx skills add yysbuge/cli#fix/apps-export-share-link -y -g

@zhmushan
zhmushan merged commit 97f0dab into larksuite:main Oct 12, 2026
27 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants