Skip to content

message ls treats an unknown identity as an empty inbox with exit 0 #57

Description

@schickling-assistant

Problem

st2 message ls cannot distinguish a valid agent with no mail from an identity that does not exist in the catalog.

$ st2 message ls example-host.no-such-agent
# 0 messages in example-host.no-such-agent inbox
$ echo $?
0

$ st2 message ls --json example-host.no-such-agent
[]
$ echo $?
0

A typo or incorrect ST_AGENT therefore fails silently in the safe-looking direction: the caller concludes there is no mail while messages may be waiting under the real identity.

The adjacent read commands already distinguish the case:

$ st2 status example-host.no-such-agent
Error: no agent 'example-host.no-such-agent' found in catalog ...
$ echo $?
1

$ st2 resource ls example-host.no-such-agent
Error: no agent 'example-host.no-such-agent' found in catalog ...
$ echo $?
1

Expected

When an explicit identity is not declared in the selected catalog, message ls should report that fact and exit nonzero, consistently in human and JSON modes. A valid declared agent with an empty inbox should remain 0 messages / [] with exit 0.

If reading undeclared bus paths is intentionally supported, it needs an explicit opt-in so the default agent-facing read cannot silently accept a misspelled identity.

Why this matters

Identity propagation bugs and identity renames have existed independently (#30 and #21). Even when those write/launch paths are fixed, the inbox read boundary should detect an unknown destination instead of converting it into an apparently healthy empty state.

This is distinct from #41, #42, and #44, which concern Agent Spec publication, retirement, and task adoption.

Version

  • st2 0.1.0+6f1fe48
  • source 6f1fe484b517406b80d06f335997859b1a53f609
  • Linux

Activity

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

    area:messageNative message bus, inbox, archive, and receipts · Set: manualorigin:agentFiled or primarily produced by an AI agent · Set: manualtype:bugSomething broken or a regression · Set: manual

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions