Skip to content

test: cover profile edges and telegram /start boundaries - #175

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-df03
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-df03

Conversation

@cursor

@cursor cursor Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered:

  • Named profiles (~/.lich/profiles) can be soul-only, must ignore work_dir / session_dir, and must not treat a JSON array as a usable layer or fall through to the soul file.
  • Profile selection skips empty and non-string keys, and a space-padded LICH_PROFILE is rejected as an invalid name.
  • lich profile rejects extra arguments, missing names, path-like names, a non-TTY create, and a cancelled wizard without writing a file. list ignores non-slug filenames. use accepts a soul-only profile.
  • Telegram /start@bot with no payload is still rewritten to hello. /start/foo, /start@, and Discord /start stay literal. A failed gateway reply() carries no usage, and handle() drops an empty final reply while reply() returns the empty text.

Test files updated:

  • test/cli_config.test.ts
  • test/first_run.test.ts
  • test/gateway.test.ts

Why this reduces regression risk:
These paths landed in #170–#172 and #174. The existing tests cover the happy merge and the reported /started case. A loosened profile slug, a profile that redirects work_dir, a corrupt profile JSON that silently becomes a soul, or a /start prefix match would change which config and which prompt the agent runs. The new cases fail if those boundaries move.

Validation: node node_modules/vitest/vitest.mjs run test/cli_config.test.ts test/first_run.test.ts test/gateway.test.ts (104 passed) and bun x tsc --noEmit.

Open in Web View Automation 

Lock soul-only profiles, ignored project keys, bad selectors, and
profile CLI failures, plus the /start cases that must stay literal.

Co-authored-by: moikapy <[email protected]>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant