Skip to content

emrg: the feishu template reads a missing identity as an expired account #2468

Closed

Description

@argszero

What was observed

emrg/server/feishu_prompt.md is the instruction block a scheduled feishu task renders into
its prompt. Its §1 (Read) ends:

  • A CLI that cannot run, or an account whose authorisation has expired, is a blocked item
    reported to the host.

That sentence names two causes of an unavailable account and gives both the same remedy: report
it blocked. There is a third cause, and it needs no one.

lark-cli resolves its identity from directories under $HOME — $HOME/Library/Application Support/lark-cli/ holds the encrypted token material and its master key, with a separate
$HOME/.lark-cli/ holding config.json and locks. An identity is therefore not a property of
the tool but of the environment the tool is started in: the same account reads missing identity
under one HOME and valid under another. A round that runs the CLI in an environment other than
the one the account was authorised in sees missing about a token that is working.

Why it matters

Two harms, and the second is the worse one.

  1. The report cannot be told apart from a real expiry. The round reports blocked, the host reads
    "the account expired", and every following round says the same thing about a working account.
  2. The obvious next step is a fresh authorisation. That is a change to the host's account state,
    taken on a symptom — and it does not cure the round, because a different HOME reproduces the
    symptom whatever the token says.

What the fix must satisfy

  • §1 states that missing identity is a symptom rather than a cause, and says where the identity
    comes from.
  • The round checks with auth status in the same environment the send will use, and reports the
    cause it read rather than the word the call printed.
  • A round never starts a fresh authorisation on a single missing answer.
  • The two real causes stay exactly as they are: a CLI that cannot run, and an account that
    genuinely cannot authenticate. Forbidden is unchanged, word for word.
  • The new clause is pinned by tests/test_scheduler.py, which already pins the template's other
    four anchors. A clause that spans a line break is pinned after its whitespace is collapsed: a
    raw substring pin decides where the wrap falls, and can be left green by a word-level negation
    (measured on this change — a pin on start a fresh authorisation … survived Never rewritten
    to You may).

Out of scope

The CLI and its credential layout. Every path, account name and per-installation override belongs
in the task's extra_prompt and stays out of the template.

Activity

  1. argszero commented on Oct 22, 2026

    @argszero
    OwnerAuthor

    Handled by #2469

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions