Most/Docs

most-cli messages edit

Replace a sent message's text (POST /v3/chats/{chat_id}/messages/{message_id}/edit).

Invocation#

sh
most-cli messages edit <chat_id> <message_id> --message <text> [--text]

Purpose#

Replace a sent message's text (POST /v3/chats/{chat_id}/messages/{message_id}/edit).

Calls `POST /v3/chats/{chat_id}/messages/{message_id}/edit` on the service `MOST_BASE_URL` names with the bearer `MOST_AGENT_API_TOKEN`. This command has no MCP tool: what reaches people in a chat is an operator's decision, not an agent's.

Inputs and options#

  • a chat id (required, positional 1).
  • a message id (required, positional 2).
  • `--message <value>` (required).
  • `--text`, anywhere on the line: print the answer as `key: value` lines for a person.

Output and state effect#

Mutating on the service and outside it: the people in the chat see what is sent, edited, taken back, reacted or typed. Prints the service's answer and exits 0; a route that answers nothing (typing) prints nothing. What a value means (a reaction or effect name) is the service's to judge, and its refusal is the answer. The client writes nothing.

Refusals#

  • `reading the command line: messages has no subcommand {verb}; it takes one of: {verbs}` — exit 2. Fix: run one of `most-cli messages {verbs}` as `most-cli --help` shows (cause `most.agent.messages.verb-unknown`).
  • `reading the arguments of messages {verb}: messages {verb} requires {subject}` — exit 2. Fix: give it as `{usage}` (cause `most.agent.messages.subject-missing`).
  • `reading the arguments of messages {verb}: messages {verb}: unexpected argument {word}; it takes {subjects}` — exit 2. Fix: give only the arguments `{usage}` shows (cause `most.agent.messages.argument-unexpected`).
  • `reading the arguments of messages {verb}: messages {verb}: unknown option --{option}; {takes}` — exit 2. Fix: use only the options `{usage}` shows (cause `most.agent.messages.option-unknown`).
  • `reading the arguments of messages {verb}: messages {verb}: --{option} needs a value` — exit 2. Fix: give the value after --{option}, as `{usage}` shows (cause `most.agent.messages.option-value-missing`).
  • `reading the arguments of messages {verb}: messages {verb}: --{option} is given more than once, and the command sends one` — exit 2. Fix: give --{option} once, as `{usage}` shows (cause `most.agent.messages.option-repeated`).
  • `reading the arguments of messages {verb}: messages {verb} requires --{option}` — exit 2. Fix: give it as `{usage}` (cause `most.agent.messages.option-missing`).
  • `reading the arguments of messages {verb}: messages {verb}: --effect is {effect}, not a type and a name joined by /` — exit 2. Fix: give the effect as bubble/<name> or screen/<name>, a name the Messages data page lists under Message effects (for example screen/confetti) (cause `most.agent.messages.effect-unreadable`).
  • `finding the Most service: MOST_BASE_URL is not set, and no origin is assumed in its place` — exit 1. Fix: set MOST_BASE_URL to the origin of the Most service, its scheme, host and port; `stado service directory connect most --consumer <consumer>` prints the one its placement answers at (cause `most.agent.service.origin-unset`).
  • `finding the Most service: MOST_BASE_URL is not UTF-8 text, so it names no URL` — exit 1. Fix: set MOST_BASE_URL to the origin of the Most service, its scheme, host and port; `stado service directory connect most --consumer <consumer>` prints the one its placement answers at (cause `most.agent.service.origin-not-text`).
  • `finding the Most service: MOST_BASE_URL is set but holds nothing besides whitespace and slashes` — exit 1. Fix: set MOST_BASE_URL to the origin of the Most service, its scheme, host and port; `stado service directory connect most --consumer <consumer>` prints the one its placement answers at (cause `most.agent.service.origin-empty`).
  • `finding the Most service: MOST_BASE_URL is not an absolute http or https URL` — exit 1. Fix: set MOST_BASE_URL to the origin of the Most service, its scheme, host and port; `stado service directory connect most --consumer <consumer>` prints the one its placement answers at (cause `most.agent.service.origin-not-url`).
  • `reading the bearer for {url}: MOST_AGENT_API_TOKEN is set but is not UTF-8 text, so it cannot travel as a bearer; nothing was sent without it` — exit 1. Fix: set MOST_AGENT_API_TOKEN to the bearer the Most service accepts, or unset it for a read that needs none, such as `most-cli health` (cause `most.agent.service.token-not-text`).
  • `reading the bearer for {url}: a mutation is sent only with the service bearer, and MOST_AGENT_API_TOKEN holds none; nothing was sent` — exit 1. Fix: set MOST_AGENT_API_TOKEN to the bearer the Most service accepts: the token in the file its MOST_API_TOKEN_FILE names, or the secret its MOST_AGENT_API_SECRET names (cause `most.agent.service.token-unset`).
  • `starting the HTTP client for {url}: the HTTP client could not load its TLS configuration, so no request could be made` — exit 1. Fix: repair the TLS or proxy setting the observed error names on this machine, then run the command again (cause `most.agent.service.client-unavailable`).
  • `connecting to the Most service at {url}: nothing accepted the connection at that origin` — exit 69, and sending it again can help. Fix: start the Most service MOST_BASE_URL names, or point MOST_BASE_URL at the origin it answers at; `most-cli health` shows when it answers (cause `most.agent.service.unreachable`).
  • `sending the request to {url}: the connection broke before the service answered` — exit 69, and sending it again can help. Fix: run the command again; when it keeps breaking, read the Most service's log for the request it was handling (cause `most.agent.service.unsent`).
  • `reading the answer from {url}: the service answered HTTP {status}, and its body broke off before it was read whole` — exit 69, and sending it again can help. Fix: run the command again; when it keeps breaking, read the Most service's log for the request it was answering (cause `most.agent.service.answer-unreadable`).
  • `{method} {url}: the service did not accept the bearer the request carried` — exit 1. Fix: set MOST_AGENT_API_TOKEN to the bearer the Most service accepts: the token in the file its MOST_API_TOKEN_FILE names, or the secret its MOST_AGENT_API_SECRET names (cause `most.agent.service.refused-auth`).
  • `{method} {url}: what the request names does not exist on the service` — exit 1. Fix: name one that exists: the list reads (`most-cli calls`, `most-cli accounts`, `most-cli webhook-outbox`) show what the service holds (cause `most.agent.service.refused-absent`).
  • `{method} {url}: the service refused the request for what it asked` — exit 1. Fix: change what the answer names and send it again; `most-cli --help` lists each command's arguments (cause `most.agent.service.refused-request`).
  • `{method} {url}: the service is not set up to do what the request asked` — exit 1. Fix: declare what the answer names on the Most service's host (its MOST_* settings and composition, see the operations page), then send it again (cause `most.agent.service.refused-unconfigured`).
  • `{method} {url}: the service or a dependency of it is limiting how often it is asked` — exit 69, and sending it again can help. Fix: send it again later (cause `most.agent.service.throttled`).
  • `{method} {url}: the service or a dependency of it did not answer in time` — exit 69, and sending it again can help. Fix: send it again; when it keeps timing out, read the Most service's log for the dependency it waited on (cause `most.agent.service.timed-out`).
  • `{method} {url}: a dependency of the service is down` — exit 69, and sending it again can help. Fix: send it again; when it stays down, read the Most service's log, which names the dependency and its cause (cause `most.agent.service.unavailable`).