How AI Coding Assistants Show Progress While Editing Code: A Companion-Based State Feedback Design

    This article explores why the waiting period while an AI coding assistant modifies code feels frustrating, and how to deliver trustworthy, staged progress feedback instead of a misleading percentage bar. It presents a companion-based design using a lightweight character, models the assistant's turn with a four-state finite state machine covering idle, working, done, and interrupted, and compares two rendering approaches: half-block character pixel art in terminals and pixel sprites on desktop clients. It also covers performance, reliability, accessibility, parallel subtask aggregation, and enterprise-level observability and governance practices.

    1. The Problem: Why Waiting Feels Uncomfortable When an Assistant Edits Code

    Using an AI coding assistant to modify code has become part of many developers’ daily routine. For a moderately complex task, such as “add parameter validation to this endpoint and fix the related unit tests,” the assistant usually needs to read several files, locate the call chain, write the changes, and run tests to verify them. The whole process can last from tens of seconds to several minutes. During this time, the terminal cursor sits still, or only a few scattered log lines scroll by. On the surface, the assistant is thinking, but users have no way to tell what it is actually doing.

    This kind of “waiting without feedback” triggers a chain of problems:

    • Lost attention: Users switch to other pages or tasks, then come back and miss a confirmation request the assistant raised in the middle of its work.
    • Misreading it as a hang: A long period without output is easily interpreted as a stalled process, so users restart the session and throw away the analysis that was just completed.
    • Ineffective nudging: Users repeatedly send messages like “Done yet?” or “Are you still there?”, interrupting the flow in progress and consuming unnecessary compute.
    • Missing the right moment: Not being able to tell whether the assistant is reading a file or running a command makes it hard to decide whether to add context now or let it finish first.
    • No explanation after interruption: When a task is canceled or an error occurs, the interface often simply goes quiet, leaving users to reconstruct what happened from logs.

    It is worth noting that waiting experience depends on more than just duration. Users can accept a five-minute wait, but usually only when they know “what it is doing” and “roughly how much longer.” A coding assistant’s execution consists of model reasoning plus a series of tool calls, and the time for a single step is inherently hard to predict precisely. So the practical approach is not to promise an exact completion time, but to provide trustworthy staged feedback: feedback that lets users answer three questions at any moment:

    1. Is the assistant working, finished, or interrupted?
    2. If it is working, what kind of operation is it performing right now?
    3. Is this feedback real and reliable, rather than “pretending to be busy”?

    The Essential Difference from a Progress Bar

    Drawing on human-computer interaction research into how systems communicate with users, how much users trust a system depends largely on whether it “seems to be listening and acting.” The same conclusion applies to coding assistants. However, a coding assistant’s work differs from downloading a file or installing software: the number of steps changes dynamically with the task, and single-step duration fluctuates significantly. A generic percentage progress bar is both inaccurate and misleading.

    A more appropriate idea is staged expression:

    Traditional Progress Bar Staged Status Feedback
    Depends on an estimable total (such as file size in bytes) Driven by execution events, with no need to estimate a total
    Emphasizes precise percentages Emphasizes clear states and trustworthy transitions
    Only reports progress, without explaining what is happening Shows both the current state and the current action
    Must be embedded in the main interface Can exist independently of the workspace

    2. The Core Idea: Handing the Waiting Period to a Lightweight Companion

    2.1 Giving Those Idle Minutes a “Role”

    Some people hand those minutes to a small companion: a quiet pet. It sits beside the conversation window, does not steal focus, and does not nag. When a message is sent, it lowers its head and reads a book; when the reply ends, it lifts the book and smiles; when there is nothing to do, it holds the book and stares blankly, with a line underneath saying “Waiting for you.”

    What makes this design distinctive is that it offers almost no productivity features: it does not write code, does not look up information, and does not think for the user. Its value shows up in three ways:

    • Occupying attention: During idle gaps, users always want something to do. A quiet little character gives them “something to watch” without being distracting.
    • Conveying state: Each character pose maps one-to-one to an assistant execution state, so a single glance tells users whether to wait or act.
    • Providing emotional value: A bit of warmth is injected into a boring wait, easing some of the fatigue of long sessions with a coding assistant.

    2.2 Non-Functional Modules Have Real Value

    Many people assume, when building developer tools, that a tool which does not “do work” has no value. Interestingly, reality often gives a different answer. One developer’s experience is representative. He had built several small efficiency tools for coding assistants, and most of them drew lukewarm responses after release. The only one that other developers “replicated” (that is, copied the code, modified it themselves, and continued developing it) was a small helper module used only to change the interface background image. This kind of module improves no task efficiency, yet it attracted more attention and reuse than serious efficiency tools.

    This phenomenon is not accidental. There are at least three reasons behind it:

    • The need is real and widespread: Developers who spend long hours with coding assistants genuinely face the problems of “nothing to do” and “no sense of where things stand” during the wait.
    • Low barrier and open to participation: The module’s logic is simple, anyone can read and modify it into their own character, and it is naturally suited to reuse and derivative creation.
    • Smooth distribution: Coding assistant users are themselves developers; when they see something they like, they replicate and use it directly, so the distribution chain is short.

    From this, one product judgment can be drawn: when evaluating a developer tool, you cannot look only at “how many tasks it completes”; you must also look at “which real feeling it solves.” Efficiency can be mined through shortcuts and automation, but the mindset during waits and the sense of control over the process are often the parts most easily overlooked by a feature list.

    2.3 General Design Principles for Companion-Style Interaction

    If you want to add similar companion-style status feedback to your own AI coding tool, you can follow these principles:

    1. Only express state, never intervene in execution logic: Under no circumstances should it block, delay, or interfere with the assistant’s own reasoning and tool calls.
    2. Keep state mapping stable and unique: The same pose should always mean the same state; avoid introducing ambiguous semantics just to “add more expressions.”
    3. Do not provide false feedback: Before a task truly ends, it must never show a “done” appearance early.
    4. Low intrusion and easy to dismiss: It should not change the workspace layout by default, and users can hide it at any time.
    5. Customizable: Support replacing the character’s appearance and wording to suit different teams’ preferences.

    3. State Modeling: Using a Finite State Machine to Describe One Turn of the Assistant

    3.1 Four Core States

    A companion character’s expressions, actions, and prompts are essentially external projections of state. A clear state model is the prerequisite for trustworthy feedback. One turn of the assistant can be abstracted into four core states:

    State Trigger Condition Example Visual Expression Exit Condition
    Idle Session is ready, or the done state auto-falls back after timing out Stands quietly, holding the book and staring blankly, with “Waiting for you” Receives a user message
    Working Receives a user message; calls a tool; receives a tool result Reads with head down, showing the current tool name below Turn ends, errors, or is canceled
    Done The assistant’s turn ends with normal output Lifts the book and smiles Auto-falls back to idle after a brief pause
    Interrupted User actively interrupts or an error occurs during execution Does not show a “done” expression; returns directly to idle Receives a user message

    Two details are worth expanding.

    First, “done” is only a brief transient state. It stays for a few seconds (for example, 8 seconds) and then returns automatically to idle, for two reasons: one, to give users time to notice the result; two, to avoid leaving the interface stuck on “done” for a long time, which could create the misunderstanding that “it is still processing.” The duration is best made configurable to match different users’ reading pace.

    Second, interrupted and done must be distinguished. When a turn is interrupted or an error occurs, the character does not show a “done” expression but returns directly to idle. The reason is that users are most likely to mistake “quiet” for “finished.” If interruption and completion produce the same signal, users may proceed to the next step based on a wrong judgment.

    3.2 State Transitions and Event Sources

    The state machine’s inputs come from the session lifecycle and the tool execution process. You can typically listen to these events:

    • Session/message events: User sends a message, assistant starts responding, response ends.
    • Tool call events: Tool starts executing, execution returns successfully, execution fails.
    • Interrupt and error events: User cancels, runtime exception occurs.
    • Timer events: The done state auto-falls back.

    The value of event-driven design lies in accuracy and timeliness. Polling-based checks require repeatedly querying the assistant’s state, which adds overhead and makes it hard to catch the exact moment when it “just finished.” Event-driven design, by contrast, gives every state transition a clear basis.

    3.3 Reference Implementation

    The following describes a minimal, usable state machine in pseudocode (shown here in Python style; actual projects can choose based on their tech stack):

    1. from enum import Enum
    2. from dataclasses import dataclass, field
    3. import time
    4. class PetState(Enum):
    5. IDLE = "idle" # Idle
    6. WORKING = "working" # Working
    7. DONE = "done" # Done
    8. INTERRUPTED = "interrupted" # Interrupted (visual expression that immediately returns to idle)
    9. @dataclass
    10. class SessionState:
    11. current_state: PetState = PetState.IDLE
    12. current_tool: str | None = None # Tool currently being called
    13. done_since: float | None = None # Timestamp when entering the done state
    14. done_hold_seconds: float = 8.0 # Duration of the done state, configurable
    15. # 1. User sends a message: enter working state, clear tool info
    16. def on_user_message(self, now: float) -> None:
    17. self.current_state = PetState.WORKING
    18. self.current_tool = None
    19. self.done_since = None
    20. # 2. Tool starts executing: stay in working state, record tool name
    21. def on_tool_start(self, tool_name: str) -> None:
    22. if self.current_state != PetState.WORKING:
    23. self.current_state = PetState.WORKING
    24. self.current_tool = tool_name
    25. # 3. Tool execution ends: the turn is not over yet, stay in working state
    26. def on_tool_end(self, success: bool = True) -> None:
    27. self.current_tool = None
    28. if not success and self.current_state == PetState.INTERRUPTED:
    29. return # An error has already triggered the interrupted state; do not override
    30. # 4. The turn ends normally: enter done state, record the time
    31. def on_turn_end(self, now: float) -> None:
    32. if self.current_state == PetState.INTERRUPTED:
    33. return # An interrupted turn is not marked as done
    34. self.current_state = PetState.DONE
    35. self.current_tool = None
    36. self.done_since = now
    37. # 5. User interrupts or an error occurs: no longer show a done expression; return to idle immediately
    38. def on_interrupt(self) -> None:
    39. self.current_state = PetState.INTERRUPTED
    40. self.current_tool = None
    41. self.done_since = None
    42. # 6. Timer: the done state automatically falls back to idle when the time is up
    43. def tick(self, now: float) -> None:
    44. if self.current_state in (PetState.DONE, PetState.INTERRUPTED):
    45. if now - (self.done_since or now) >= self.done_hold_seconds:
    46. self.current_state = PetState.IDLE
    47. self.done_since = None

    When implementing, there are three error-prone boundaries:

    • Late events from an old turn: If a tool result from the previous turn arrives after the next turn has already started, it must not change the state back. You can assign an incrementing turn number to each turn and verify, when handling events, whether the number still matches the current turn.
    • The done state interrupted by a new message: If the user sends a message while the done state is still showing, it should immediately switch back to the working state and clear the timer.
    • Priority between error and interrupt: After an interrupt occurs, subsequent tool errors should not override the interruption reason. Keep a clear rule such as “first-come-first-served” or “interrupt takes priority” to avoid the state flipping back and forth.

    4. Rendering Layer: Two Presentation Styles for Terminal and Desktop

    Once the state is determined, it needs to be “drawn.” A coding assistant may run in a desktop client or in a terminal. The two environments differ greatly in rendering capability and need to be designed separately.

    4.1 Terminal: Using Half-Block Characters to Draw Pixel Art

    A terminal is essentially a character grid and cannot draw images directly, but it can implement “pseudo-pixel art” by cleverly using characters. The core trick is the half-block character (▀, the “upper half block” in Unicode). It shows the foreground color in the upper half of the cell and the background color in the lower half. So each character row can carry two pixel rows:

    • Split the character’s image by “each character corresponding to two vertical pixels”;
    • Use the upper pixel’s color as the foreground color and the lower pixel’s color as the background color;
    • Set the foreground and background colors with ANSI escape sequences, then output the half-block character to assemble a colored image.

    Placing the character in an area about 36 columns wide, with the overall height controlled to around 16 lines, yields a clearly recognizable pixel bust. Most modern terminals display this kind of character correctly, so it is “not picky about terminals.”

    Terminal rendering also requires attention to these engineering details:

    1. Fixed size and local redraw: Reserve an area with fixed width and height, and redraw only that area when content changes, avoiding full-screen refresh that causes flicker.
    2. Cursor management: Hide the cursor during drawing and restore it after drawing. Before redrawing, move the cursor back to the start of the area and clear the old content line by line.
    3. Color capability detection: Terminals may support only monochrome, 16 colors, 256 colors, or true color. Fall back on the color scheme based on detection results, ensuring the image remains recognizable in lower-capability terminals.
    4. Narrow terminal adaptation: Side-by-side display relies on sufficient window width. When the terminal is narrow, keep only one line of status text to avoid squeezing the command input area.

    The code below illustrates how to encode pixel art into half-block character lines that a terminal can output (conceptual example):

    1. # Assume sprite is a 2D pixel array, where each pixel is an (r, g, b) color triple
    2. # Each terminal character row corresponds to two pixel rows of the image: upper pixel as foreground, lower pixel as background
    3. def encode_half_block_lines(sprite):
    4. lines = []
    5. for y in range(0, len(sprite), 2):
    6. chars = []
    7. for x in range(len(sprite[0])):
    8. upper = sprite[y][x]
    9. lower = sprite[y + 1][x] if y + 1 < len(sprite) else upper
    10. # Foreground = upper pixel, background = lower pixel, content = upper half block character
    11. chars.append(f"\x1b[38;2;{upper[0]};{upper[1]};{upper[2]}m"
    12. f"\x1b[48;2;{lower[0]};{lower[1]};{lower[2]}m▀")
    13. chars.append("\x1b[0m") # Reset color at end of line
    14. lines.append("".join(chars))
    15. return lines

    4.2 Desktop: Pixel Art and Adaptive Layout

    In a graphical desktop client, the same character can be presented as a full pixel-art image, with better clarity and detail. Desktop rendering needs to focus on:

    • Layout without occlusion: Place the character beside the conversation area or in a sidebar; it must not cover messages, the input box, or buttons.
    • Size adaptation: Automatically shrink or collapse when the window is narrow, and show the full image when it is wider.
    • Controllable resource overhead: Animate using sprite sheets with frame-by-frame switching, control the refresh rate, and pause rendering when not visible.
    • Cross-platform consistency: Use unified asset files and scaling strategies across different operating systems.

    4.3 Driving Multiple Rendering Frontends from One State Model

    Terminal and desktop rendering capabilities differ, but the state semantics should be completely consistent. The recommended approach is: the state machine is the single source of truth, exposing only abstract data such as “current state + current tool + wording” to the outside; each rendering frontend is responsible for translating that data into its own visual expression.

    1. Session/tool events ──> State machine (single source of truth) ──> State snapshot
    2. │
    3. ┌──────────────┴──────────────┐
    4. ▼ ▼
    5. Terminal frontend (half-block chars) Desktop frontend (pixel art/graphics)

    This way, adding a new rendering frontend (such as a web frontend) requires no changes to the state logic, and the state model can also be tested independently.

    5. Performance, Reliability, and Accessibility

    5.1 Performance: Companionship Must Not Slow Down the Assistant

    • Asynchronous rendering: Rendering runs in a separate thread or coroutine, receiving state changes through a message queue, and never drawing synchronously on the main execution path.
    • Throttled refresh: Limit the refresh rate and redraw only when the state or frame content changes; the character stays static when idle.
    • Resource budget management: The memory and CPU used by a single character should be kept to a very small range; in multi-session scenarios, loaded assets can be shared.

    5.2 Reliability: Silent Failure

    Any exception in the companion module should not affect the coding assistant’s main flow. Recommended strategies include:

    • Wrap all event callbacks in exception handling, logging the error and skipping that render when something goes wrong;
    • Automatically disable with a notice when the module fails to load, without affecting the session itself;
    • Decouple from core logic so users can uninstall it at any time.

    5.3 Accessibility: More Than Just “Cute”

    • Text equivalents: Provide text descriptions alongside the character state, such as “Calling tool: read file.” Screen readers can read these aloud, but accessibility support must not be empty talk. To that end, the specific values of attributes such as role and aria-label need to be set according to the target platform’s accessibility standards and verified through actual testing.
    • Do not rely on a single channel: State must not be conveyed by color or animation alone; provide both pose and text.
    • Reduce motion: Respect the system’s “reduce motion” preference and offer a static mode.

    5.4 Extension: Aggregating the State of Parallel Subtasks

    The problem gets more complex when the assistant splits a task among multiple sub-agents running in parallel. There are two trade-offs here: one is to not present subtask details, tracking only the main conversation’s state to avoid the picture jumping frequently; the other is to show aggregated information in the status text, such as “3 subtasks in progress.” Both approaches can coexist, and a configuration option can let users choose.

    6. From Single Machine to Teams: Extending to Enterprise Scenarios

    The discussion above is mainly aimed at individual developers. When using AI coding tools in enterprise or team environments, the need for status feedback extends to observability and governance:

    • Execution trace logging: Record sessions, tool calls, and results via log services to facilitate post-hoc tracing and auditing.
    • Key metric monitoring: Set baselines for metrics such as task duration and failure rate, and use monitoring and alerting to detect anomalies promptly.
    • Asynchronous task decoupling: Long-running tasks can be queued via message queues to avoid blocking interactive sessions.
    • Tool environment isolation and extension hosting: Apply access control and isolation to tools such as code execution and test running; plugins and other extensions can run on container platforms for unified deployment and upgrades.

    At the same time, enterprise adoption also needs to meet compliance requirements:

    • Before displaying the current tool name, check whether it contains sensitive information such as internal file paths or keys, and mask it or show only the tool category when necessary;
    • Extensions and plugins must pass signature verification and follow least-privilege permissions;
    • Character assets and interaction wording should be reviewed centrally to ensure they fit the usage scenario.

    If a platform builds AI coding assistants or agent applications on Baidu AI Cloud, it can use general capabilities such as log services, monitoring and alerting, message queues, and container platforms to build the observability and governance chain described above. Status visualization focuses on experience, while the observability system focuses on trustworthiness; the two complement each other.

    7. From “Cute” to “Useful”: Lessons from Practice

    Back to the original question: what should happen during the few minutes when a coding assistant edits code? For users, it can be a quiet pet reading a book; for developers, it is an interaction problem worth designing carefully.

    It has three layers:

    • State layer: Accurately model idle, working, done, and interrupted with a finite state machine;
    • Rendering layer: Use terminal half-block characters and desktop pixel art to translate state into intuitive visual language;
    • Engineering layer: Use asynchronous rendering, exception isolation, and accessibility to ensure feedback is trustworthy, lightweight, and non-intrusive to the main flow.

    A few lessons are especially worth remembering:

    1. Trustworthy matters more than rich: State signals must correspond strictly to actual execution; a single wrong “done” prompt is enough to make users lose trust.
    2. Lightweight matters more than flashy: The value of a companion module lies in “not disturbing”; the smaller the resource footprint, the more likely it is to stay in the environment long-term.
    3. Generic matters more than custom: Separating the state model from the rendering frontend is what allows reuse across terminals, desktops, and future new environments.
    4. Open-source sharing amplifies value: Low-barrier, easily modifiable modules are more likely to be reused and adapted by the community, refining the design as they spread.

    If you are building your own AI coding assistant, you might start with a simple state transition diagram, then choose a suitable rendering carrier, and iterate step by step. A small character holding a book may well make a long wait feel less unbearable.