Skip to content

optimize: remove fenced code block guidance from auth URL output hints#1088

Merged
JackZhao10086 merged 1 commit into
mainfrom
feat/auth_hint
May 25, 2026
Merged

optimize: remove fenced code block guidance from auth URL output hints#1088
JackZhao10086 merged 1 commit into
mainfrom
feat/auth_hint

Conversation

@JackZhao10086

@JackZhao10086 JackZhao10086 commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Remove fenced code block guidance from auth URL output hints. Wrapping verification_url in code blocks makes the link unclickable for end users; the existing "opaque string, do not modify" constraint is sufficient to prevent AI agents from altering the URL.

Changes

  • Remove "Prefer a fenced code block containing only the raw URL" / "建议用仅包含该 URL 的代码块单独输出" from AgentTimeoutHint (zh & en) in cmd/auth/login_messages.go
  • Remove same guidance from --no-wait --json hint in cmd/auth/login.go
  • Remove redundant "so the user can either scan or copy the link" / "确保用户可扫码或复制链接" from display order instructions
  • Sync URL forwarding rules in skills/lark-shared/SKILL.md
  • Update test assertions in cmd/auth/login_test.go to match

Test Plan

  • Unit tests pass (go test ./cmd/auth/ -count=1)
  • Manual local verification confirms the lark-cli auth login command works as expected

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Updated authentication guidance regarding QR code and verification URL display requirements, including proper display order and format specifications.

Review Change Stack

@github-actions github-actions Bot added the size/L Large or sensitive change across domains or core paths label May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fe6af630-c2f9-400c-91ee-2c711531c312

📥 Commits

Reviewing files that changed from the base of the PR and between b25ff1c and 98d585c.

📒 Files selected for processing (4)
  • cmd/auth/login.go
  • cmd/auth/login_messages.go
  • cmd/auth/login_test.go
  • skills/lark-shared/SKILL.md
💤 Files with no reviewable changes (1)
  • cmd/auth/login_test.go

📝 Walkthrough

Walkthrough

This PR updates auth device-flow login messages and documentation to refine QR code display guidance. The hint field in --no-wait JSON output and the AgentTimeoutHint prompts (English and Chinese) now explicitly require agents to display QR images in responses with URL-first ordering, while removing prior fenced-code-block suggestions. Tests and documentation are updated consistently.

Changes

QR Code Display Guidance Update

Layer / File(s) Summary
QR code and URL display requirements
cmd/auth/login.go, cmd/auth/login_messages.go, skills/lark-shared/SKILL.md
The --no-wait JSON hint field and the Chinese/English AgentTimeoutHint prompt texts are updated to mandate explicit QR image display in responses with URL-first ordering, while removing prior guidance to wrap the URL in a fenced code block and updating opaque-URL wording. Documentation updates remove the code-block output suggestion.
Test assertion updates
cmd/auth/login_test.go
Test assertions in two login tests are modified to validate the new QR code display and URL handling requirements, replacing prior expectations about code-block formatting with assertions for QR image placement, opaque-string handling, and correct display ordering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • larksuite/cli#942: Directly overlaps with QR-code support work that adds/updates login hint messaging for QR display and verification URL handling.
  • larksuite/cli#968: Updates the same auth hint/agent-hint guidance strings in identical files to require QR code generation and opaque URL handling.
  • larksuite/cli#933: Modifies the same auth device-flow guidance strings to control how agents present verification URLs and QR code details.

Suggested labels

size/M

Suggested reviewers

  • liangshuo-1
  • albertnusouo
  • XingjianSun

Poem

🐰 A clearer path for codes to show,
🔲 QR images steal the glow,
URLs first, then pictures below,
No more fences hiding flow,
The agent's guidance now will grow! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing fenced code block guidance from auth URL output hints across multiple files.
Description check ✅ Passed The description follows the template structure with clear Summary, Changes, Test Plan, and Related Issues sections. All required information is present and complete.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/auth_hint

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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 and usage tips.

@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.85%. Comparing base (aea9f37) to head (98d585c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1088   +/-   ##
=======================================
  Coverage   67.85%   67.85%           
=======================================
  Files         592      592           
  Lines       55373    55373           
=======================================
  Hits        37574    37574           
  Misses      14685    14685           
  Partials     3114     3114           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@98d585c5162f88ab4e0ae61ac511f34c99667c64

🧩 Skill update

npx skills add larksuite/cli#feat/auth_hint -y -g

@JackZhao10086
JackZhao10086 merged commit 06a3921 into main May 25, 2026
22 checks passed
@JackZhao10086
JackZhao10086 deleted the feat/auth_hint branch May 25, 2026 14:37
@liangshuo-1 liangshuo-1 mentioned this pull request May 26, 2026
3 tasks
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.

2 participants