Skip to content

fix: silence misleading "skills not installed" startup notice#801

Open
niuchong0523 wants to merge 1 commit intomainfrom
fix/skillscheck-disk-fallback
Open

fix: silence misleading "skills not installed" startup notice#801
niuchong0523 wants to merge 1 commit intomainfrom
fix/skillscheck-disk-fallback

Conversation

@niuchong0523
Copy link
Copy Markdown
Collaborator

@niuchong0523 niuchong0523 commented May 10, 2026

Summary

Remove the cold-start _notice.skills ("skills not installed, run: lark-cli update") that fires whenever ~/.lark-cli/skills.stamp is missing. The stamp is written exclusively by lark-cli update, so users who installed skills via npx skills add larksuite/cli -g (the documented path) saw the misleading notice on every CLI run despite a fully populated ~/.agents/skills/.

The version-drift notice (stamp version != binary version) is preserved unchanged for users who opted into tracking by running lark-cli update.

Changes

  • internal/skillscheck/check.go - Init returns silently when the stamp file is missing; documents cold-start as an explicit failure mode.
  • internal/skillscheck/notice.go - StaleNotice.Message drops the dead cold-start branch; Current is now guaranteed non-empty.
  • internal/skillscheck/check_test.go - replace TestInit_ColdStart_NoticeWithEmptyCurrent with TestInit_ColdStart_NoNotice asserting silence.
  • internal/skillscheck/notice_test.go - drop the cold_start row from TestStaleNotice_Message.
  • cmd/root_integration_test.go - rename TestSetupNotices_ColdStart to TestSetupNotices_ColdStart_NoNotice and assert the skills key is absent.
  • No new files, no env vars, no schema changes. JSON output for _notice.skills keeps the same {current, target, message} shape - only the cold-start message string is no longer possible.

Test Plan

  • make unit-test passed
  • validate passed (build / vet / unit / integration / convention / security all green)
  • local-eval passed: skipped - sandbox auth-login pre-flight failed on the test account's scope grant for 7 unrelated scopes (approval / attendance / im:message.send_as_user / mail:user_mailbox.message:send), so the sandbox exited before invoking E2E. Cross-validated via the Phase 3 dev-e2e-testcase-writer agent: 5/5 E2E cases (tests_e2e/skillscheck/...) pass against the patched code.
  • acceptance-reviewer passed (9/9 cases on a real lark-cli binary, including the npx-only sim with 128 lark-* skills on disk + no stamp)
  • manual verification: cold-start tmpdir -> no notice; echo 1.0.27 > skills.stamp (in-sync) -> no notice; echo 1.0.20 > skills.stamp + binary 1.0.27 -> expected "out of sync" notice; LARKSUITE_CLI_NO_SKILLS_NOTIFIER=1 -> silent in every state.

Related Issues

N/A

Summary by CodeRabbit

  • Bug Fixes

    • Cold-start runs no longer emit a spurious skills-status notice, improving first-run behavior.
  • Behavior

    • Notices about installed skills now always include current version when present; cold-start is treated as "no notice."
  • Tests

    • Updated tests to reflect the new no-notice cold-start expectation and removed prior empty-current test cases.

Review Change Stack

@niuchong0523 niuchong0523 added the bug Something isn't working label May 10, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4804096a-bd4f-449a-8c09-c6e73d081d5f

📥 Commits

Reviewing files that changed from the base of the PR and between 7359ba5 and 79fa471.

📒 Files selected for processing (5)
  • cmd/root_integration_test.go
  • internal/skillscheck/check.go
  • internal/skillscheck/check_test.go
  • internal/skillscheck/notice.go
  • internal/skillscheck/notice_test.go
💤 Files with no reviewable changes (1)
  • internal/skillscheck/notice_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • internal/skillscheck/check_test.go
  • cmd/root_integration_test.go
  • internal/skillscheck/check.go
  • internal/skillscheck/notice.go

📝 Walkthrough

Walkthrough

This PR eliminates the intermediate "cold-start with empty Current" notice state. When no skills stamp exists, skillscheck.Init() now returns without emitting any notice. The StaleNotice contract is tightened to guarantee Current is always non-empty, simplifying the Message() method and clarifying the initialization semantics.

Changes

Cold-Start No-Notice Behavior

Layer / File(s) Summary
Notice Contract & Guarantees
internal/skillscheck/notice.go
StaleNotice.Current is now guaranteed non-empty since cold-start does not emit a notice. Message() method removes fallback handling for empty Current.
Cold-Start Guard in Init()
internal/skillscheck/check.go
Init() returns early when stamp is empty (cold-start), skipping notice emission entirely. Documentation clarifies early-return contract. Mismatch handling updated to assume non-empty Current.
Unit Test Updates
internal/skillscheck/check_test.go, internal/skillscheck/notice_test.go
TestInit_ColdStart_NoticeWithEmptyCurrent renamed to TestInit_ColdStart_NoNotice and now asserts GetPending() is nil. "cold_start" case removed from TestStaleNotice_Message table.
Integration Test Verification
cmd/root_integration_test.go
TestSetupNotices_ColdStart replaced with TestSetupNotices_ColdStart_NoNotice, asserting composed notice either is absent or omits the skills key.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • larksuite/cli#723: Reverses or adjusts behavior introduced there; touches the same skillscheck.Init and notice functions.

Suggested labels

size/M

Suggested reviewers

  • liangshuo-1

Poem

A rabbit peeks at stamps gone cold, 🐇
No empty Current note to hold—
If no file waits, it skips the chime,
Keeps messages tidy, neat, and prime.
Hop on, tests pass — hooray, compile!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: silencing a misleading cold-start notice for the skills checker.
Description check ✅ Passed The description comprehensively covers the motivation, specific code changes, test verification, and related context, matching and exceeding the template requirements.
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 fix/skillscheck-disk-fallback

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@github-actions github-actions Bot added the size/L Large or sensitive change across domains or core paths label May 10, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/root_integration_test.go`:
- Around line 507-514: Update the test comment to reflect the new behavior:
remove or rewrite the stale lines that claim the composed PendingNotice includes
a "skills" key with an empty Current and cold-start message (the lines
referenced by TestSetupNotices_ColdStart), since
TestSetupNotices_ColdStart_NoNotice and the updated assertions expect no
"skills" key; locate the comment block around
TestSetupNotices_ColdStart/TestSetupNotices_ColdStart_NoNotice and either delete
the contradictory sentences or replace them with a concise note that a missing
stamp produces no "skills" key so the cold-start notice is not emitted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 39588b6d-80d1-4a43-b83e-50e359231fa6

📥 Commits

Reviewing files that changed from the base of the PR and between 4aceae9 and 7359ba5.

📒 Files selected for processing (5)
  • cmd/root_integration_test.go
  • internal/skillscheck/check.go
  • internal/skillscheck/check_test.go
  • internal/skillscheck/notice.go
  • internal/skillscheck/notice_test.go
💤 Files with no reviewable changes (1)
  • internal/skillscheck/notice_test.go

Comment thread cmd/root_integration_test.go Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.46%. Comparing base (4aceae9) to head (79fa471).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #801   +/-   ##
=======================================
  Coverage   65.46%   65.46%           
=======================================
  Files         510      510           
  Lines       47129    47129           
=======================================
  Hits        30851    30851           
  Misses      13607    13607           
  Partials     2671     2671           

☔ 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.

Remove the cold-start _notice.skills that fires whenever
~/.lark-cli/skills.stamp is missing. The stamp is written
exclusively by `lark-cli update`, so users who installed skills via
`npx skills add larksuite/cli -g` (the documented path) saw the
notice on every run despite a fully populated ~/.agents/skills/.

The version-drift notice (stamp != binary) is preserved unchanged
for users who opted into tracking by running `lark-cli update`.

- internal/skillscheck/check.go: Init returns silently on empty stamp
- internal/skillscheck/notice.go: drop dead cold-start branch in Message;
  Current field is now guaranteed non-empty
- tests updated in skillscheck package + cmd/root_integration_test.go
  to assert the new contract

No new files, no env vars, no JSON schema change. The _notice.skills
shape stays {current, target, message} — only the cold-start message
string is no longer possible.
@niuchong0523 niuchong0523 force-pushed the fix/skillscheck-disk-fallback branch from 7359ba5 to 79fa471 Compare May 10, 2026 14:19
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 10, 2026

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@79fa471e1a5db1ab65ef6dd7a773f678f23dc762

🧩 Skill update

npx skills add larksuite/cli#fix/skillscheck-disk-fallback -y -g

@niuchong0523
Copy link
Copy Markdown
Collaborator Author

Note: e2e-live failure is pre-existing on main, unrelated to this PR

The e2e-live job is currently red. Confirming it is not introduced by this PR before requesting merge.

Failing tests on this PR (79fa471)

All in tests/cli_e2e/sheets/:

  • TestSheets_FilterWorkflow/{create,get,update,delete}_filter_with_spreadsheet.sheet.filters_*_as_bot
  • TestSheets_CRUDE2EWorkflow/find_cells_with_+find_as_bot
  • TestSheets_SpreadsheetsResource/{create,get,patch}_spreadsheet_with_spreadsheets_*_as_bot

Same tests are failing on main

commit timestamp (UTC) e2e-live
4aceae9 (this PR's base) 2026-05-09 12:35 ❌ failure (same TestSheets_* tests + some TestCalendar_*)
44ffa98 2026-05-09 08:54 ❌ failure
f9792f0 2026-05-09 06:16 ✅ success
earlier commits ✅ success

e2e-live started consistently failing on main around 2026-05-09 ~09:00 UTC. Likely a Sheets API test-account / quota / live-service issue on the harness side; not a code regression.

This PR's diff does not touch the sheets package

cmd/root_integration_test.go
internal/skillscheck/check.go
internal/skillscheck/check_test.go
internal/skillscheck/notice.go
internal/skillscheck/notice_test.go

No file under tests/cli_e2e/sheets/, shortcuts/sheets/, or any sheets code path is modified.

All other checks pass

unit-test, lint, license-header, security, coverage, deadcode, e2e-dry-run, Analyze (go), Analyze (javascript-typescript), Analyze (python), fast-gate, publish, codecov/patch, codecov/project, Continuous Releases, CLA, sync-pr-labels — all green.

Requesting merge despite the red e2e-live. Happy to rebase once main's e2e-live is restored if reviewers prefer to wait.

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

Labels

bug Something isn't working size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant