Adding a Status Pet to Your AI Coding Assistant

    This article explains how to build a companion "status pet" component for AI coding assistants that visualizes runtime state without adding any business logic. It covers the design goals, a three-state finite state machine (IDLE, BUSY, DONE), tool-name display in the busy state, dual rendering backends using pixel art and half-block characters, installation and distribution across two host environments, extensibility through decoupled assets, and a checklist of common pitfalls. Readers will learn how a small, trustworthy completion signal can replace guesswork while waiting.

    1. Background: Capabilities Are Growing, Observability Is Not

    The reasoning and execution chains of AI coding tools are getting longer. A single answer may involve multiple rounds of tool calls, file reads and writes, command execution, and result回填. For the user, the hardest part is not the wait itself, but not knowing what they are actually waiting for. Logs must be dug through manually, progress is guesswork, and the interface stays blank.

    Three common approaches exist in the industry. The first is a plain-text progress line: accurate, but lacking emotional feedback. The second is a full graphical interface: expressive, but dependent on the host environment. The third is notification popups: effective, but costly in terms of interruption. None of them is quiet enough.

    This leads to an interesting direction: build a companion component that carries no business capability at all, and only maps runtime status to a visual form. It does not change the assistant’s behavior; it only changes how the user perceives the wait.

    2. Design Goals: Deliberately “Doing Nothing”

    The positioning of this component must be stated clearly, otherwise later requirements will spiral out of control.

    • Zero business responsibility: it does not read or write user code, does not modify files, and does not participate in decisions.
    • Three states are enough: idle, executing, and completed, covering the vast majority of interaction scenarios.
    • Explainable state: the executing state should show which kind of tool is currently in use, rather than a generic “loading”.
    • Environment adaptation: two rendering paths for desktop hosts and terminals, degrading gracefully when capabilities differ.
    • Zero configuration cost: install and use immediately, with no persona setup, no raising, and no parameter tuning.

    “Doing nothing” is not laziness, but a boundary of responsibility. Anything unrelated to status display is simply not built, which is what keeps the component stable enough.

    3. State Machine Design: Three States and Two Transition Rules

    The core is a minimal finite state machine with only three nodes.

    1. IDLE --(user input received)--> BUSY --(turn ends)--> DONE
    2. ^ | |
    3. |__________________________|____(after 8s)______|

    Two key constraints determine whether the state semantics are trustworthy:

    1. Only a normal completion enters DONE, which holds a visible feedback for about 8 seconds before falling back to IDLE.
    2. When interrupted or terminated abnormally, it does not enter DONE, and falls back to IDLE directly.

    The value of this rule is that DONE becomes a “trustworthy signal”. When the user sees the completed state, it means the turn really finished, rather than a mid-way failure being silently swallowed. Many interfaces draw failures as successes too, which instead destroys trust.

    The pseudocode can be very short:

    1. def on_turn_start(ctx):
    2. pet.state = BUSY
    3. pet.tool = ctx.current_tool or "unknown"
    4. def on_turn_end(ctx, ok: bool):
    5. if ok:
    6. pet.state = DONE
    7. schedule(reset_to_idle, delay=8.0)
    8. else:
    9. pet.state = IDLE

    4. Information Density in the Executing State: Put the Tool Name Below the Figure

    The most valuable information in the executing state is not the animation, but “which tool this step is using”. In implementation, you only need to render a short line of text below the figure, with width truncation, so that overflow ends with an ellipsis and does not break the layout.

    Three layers of protection are recommended: map tool names through a whitelist to friendly short names; fall back to generic text for unknown tools; dynamically crop text length according to available columns. This preserves information while preventing a long name from messing up the terminal layout.

    5. Dual Rendering Backends: Pixel Art and Half-Block Characters

    The same state needs two rendering implementations.

    In a desktop host environment, you can output full pixel art directly, with action frames including looking down while reading, raising the book and smiling, and standing still while waiting.

    In a terminal environment there is no graphical capability, so half-block characters can be used to compose a half-body portrait. The advantage of half-block characters is doubled vertical resolution: the upper and lower regions of the same character can express two pixel rows, achieving an effect close to pixel art in a pure text environment.

    The layout parameters are recommended to be fixed at 36 columns wide and 16 rows high, and the terminal size should be read at startup. When the width is sufficient (for example, 144 columns or more), it stays displayed on the side; when the width is insufficient, it degrades to a single-line status text, ensuring existing output is not broken.

    1. def render(pet, cols: int, rows: int) -> str:
    2. if cols < 60:
    3. return f"[{pet.state}] {pet.tool}" # degrade: single line
    4. art = ART[pet.state] # 36x16 half-block art
    5. return art + "\n" + truncate(pet.tool, cols - 2)

    The degradation strategy is the watershed for whether such a component can stay in the user’s environment long term: better ugly than disruptive.

    6. Loading and Distribution: Two Hosts, Two Paths

    Distribution needs to distinguish environments. On the terminal side, installation is done through a plugin marketplace address, with a single command. On the desktop host side, command-line installation is usually not supported; you need to first add the marketplace source in the plugin entry next to the input box, then add the specific plugin. Once installed, a short command brings up the component.

    Here you must remove all identifiable third-party addresses and command names, and replace them with neutral descriptions: the marketplace source is to be replaced by the user with a repository address they maintain themselves. If the host does not support a plugin mechanism, it degrades to a “bypass mode” that inserts status lines into the output stream, implemented by wrapping an output filter. The cost is reduced compatibility, which must be clearly noted in the documentation.

    7. Extensibility: Swap the Figure Without Touching the Logic

    The figure and the logic must be decoupled. A recommended directory structure is as follows:

    1. pet/
    2. state.py # state machine
    3. render.py # rendering and degradation
    4. assets/ # frame resources for each state
    5. hooks.py # host event adaptation

    When replacing the character, only change the resource directory and the frame mapping table; the state machine and rendering code need zero changes. If cloud-hosted resources are used, they can be placed in object storage and delivered through a content delivery network, combined with local caching and version numbers for canary rollout; monitoring and alerting can be handed to general log and monitoring/alerting capabilities, with no need to build your own.

    8. Common Pitfalls Checklist

    • Repeated event triggering causing state jitter: perform idempotent deduplication on the turn identifier.
    • Late asynchronous callbacks marking a new turn as completed: callbacks carry the turn ID and verify it.
    • Terminal width changes not triggering a redraw: listen for size change events and force a re-layout.
    • Long tool names breaking the layout: truncate uniformly.
    • Failures drawn as successes: strictly distinguish normal completion from abnormal termination.

    9. Conclusion

    The meaning of such a component lies not in functionality, but in feedback. It compresses the invisible waiting process into three readable states, replacing guesswork with a trustworthy completion signal. Engineering-wise it is small enough: one state machine, two renderers, one layer of degradation. And precisely because it is small, it is easy to accept, easy to replace, and easy to keep in the workflow long term.