Evaluating AI Coding Agents: A Practical Guide to Rebuilding a Chat Application with LLMs
This article presents a reproducible evaluation framework for comparing how different combinations of foundation models and coding agents (harnesses) rebuild a conversational web application from a reference site and API documentation. It details a controlled setup using two rounds of prompts and three required deliverables, then defines a three-tier acceptance standard covering functional documentation, a runnable replica, and a self-improved version. The article also categorizes observed behavioral differences in verification depth, defect discovery, architectural awareness, and communication clarity, and concludes with reusable recommendations for teams evaluating model and tool combinations.
1. Background and Problem Definition
When a foundation model’s capabilities are exposed through open weights or open interfaces, a common pattern emerges: the official documentation encourages developers to build end-to-end applications on top of those capabilities, sometimes even fully replicating a conversational product. For engineering teams, this is both an opportunity and a test. The opportunity is a self-owned, controllable chat frontend at relatively low cost. The challenge is the significant capability gap between “being able to generate a page” and “being able to deliver a product that can be maintained long term.”
This article is not about whether a specific product is good. It addresses a more general technical question: Given a reference site and API documentation, can different combinations of “foundation model + coding agent (harness)” reliably produce a runnable, extensible, and acceptance-ready conversational web application? And what criteria should we use to measure the differences between them?
The original practice is worth abstracting: prepare several model and tool combinations, feed them the same two rounds of prompts (requirements first, credentials second), require the same three deliverables, and then observe behavioral differences. This design works because it decouples “model capability” from “tool strategy,” making the comparison repeatable.
2. Evaluation Design: Making the Comparison Reproducible
2.1 Controlling Variables
For a horizontal evaluation to be meaningful, every variable except the “model/tool combination” must be fixed:
- Same reference target: the same conversational web site as the functional reference, and the same API documentation as the integration basis;
- Same prompts: the first round describes only the role and task; the second round adds only access credentials;
- Same deliverables: functional documentation with a structure diagram, a runnable replica page, and an “improved version based on your own experience”;
- Same operating conditions: browsing, session reuse, and debugging tools are treated equally across all combinations.
2.2 The Purpose of Two Rounds of Prompts
The core of the first-round prompt is to constrain the role and the output boundary, for example:
Assume you are a senior product manager who needs to rebuild a conversational web app.Reference site: <logged-in reference site>Integration basis: <public API call documentation>You may use the built-in browsing capability to view the pages and documentation.Deliverables:1) Product functional documentation and a page structure diagram;2) A runnable replica page;3) An improved version based on your own experience.
The second-round prompt only adds the API key. The clever part of this design is that it turns “behavior after obtaining resources” into an observable metric. Some combinations only perform the most basic connectivity check after receiving the key. Others proactively construct boundary inputs, check for interrupted streaming output, and verify error codes and retry paths, exposing defects early. This difference is not caused by the prompt; it is a natural divide in model and tool strategy.
3. Three-Tier Acceptance Criteria for Deliverables
3.1 Tier 1: Functional Documentation and Structure Diagram
Documentation is not an accessory; it is the “contract” for all subsequent work. A qualified functional document should at least include: information architecture (conversation list, message area, input area, settings area), a state machine (idle / requesting / streaming / failed / canceled), and an interface mapping table (which interaction triggers which type of request, how parameters are organized, and how errors are presented).
The structure diagram is best expressed as a simple text tree for easier version control:
App├── Sidebar (conversation list / new / delete / rename)├── ChatView│ ├── MessageList (role: user | assistant | system)│ └── Composer (multiline input / attachments / send / stop)├── Settings (model selection / temperature / context length / API key)└── Telemetry (latency / token usage / error rate)
3.2 Tier 2: A Runnable Replica Page
Runnable is the hardest acceptance line. It is recommended to check in the following order:
- First-screen usability: without a key, can the user enter the interface and get clear guidance instead of a blank screen;
- Streaming rendering: is token-by-token output stable, does scrolling follow along, and does cancellation take effect immediately;
- Context management: is the context trimming strategy for multi-turn conversations clear, and is there a fallback message for overly long input;
- Error handling: do invalid key, rate limiting, and timeout each have readable messages and a retry entry point;
- Security boundary: is the key stored only locally or behind a backend proxy, and does the frontend avoid hardcoding it.
A minimal example of a request wrapper:
async function* streamChat(messages, signal) {const resp = await fetch('/api/chat', {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify({ messages, stream: true }),signal,});if (!resp.ok) throw new Error(`HTTP ${resp.status}`);const reader = resp.body.getReader();const decoder = new TextDecoder();while (true) {const { value, done } = await reader.read();if (done) break;yield decoder.decode(value, { stream: true });}}
3.3 Tier 3: The Self-Improved Version
The third deliverable best reflects “engineering intuition.” Improvements usually focus on: conversation persistence and retrieval, Markdown and code highlighting, keyboard shortcuts and accessibility, observability instrumentation, and cost control (context trimming, cache reuse). Whether a combination can propose improvements with tradeoffs rather than piling on features is the key distinction between “can write code” and “understands the product.”
4. Categorizing and Interpreting Behavioral Differences
Under the same criteria, the observed differences fall into four categories:
- Verification depth: only a connectivity check vs. proactively constructing boundary and exception scenarios;
- Defect discovery: whether issues such as interrupted streaming, duplicate rendering, and state desynchronization can be found before delivery;
- Architectural awareness: whether the key proxy, conversation storage, and error reporting are layered, rather than all crammed into the frontend;
- Communication cost: whether the documentation is clear enough for another engineer to take over.
It should be emphasized that these differences come more from the strategy of the “model + tool” combination than from a single metric. Therefore, selection should not look only at generation speed, but at the self-driven verification capability after obtaining real resources.
5. Reusable Implementation Recommendations
- Define acceptance before generation: write the three-tier deliverables as a checklist and use them as assertions for automated evaluation;
- Institutionalize the two-round prompts: constrain the role and output in the first round, inject credentials in the second, and observe behavior changes;
- Build a regression test set: turn rate limiting, timeouts, overly long context, and request cancellation into fixed test cases;
- Separate credentials from the proxy: the key should exist only in a server-side proxy or secure local storage and never be persisted in the frontend;
- Prioritize observability: the quality of a chat application depends heavily on logs, monitoring alerts, and latency distribution, so it is advisable to reserve integration points for logging services and monitoring alerts in the architecture; if multi-platform deployment is involved, static assets can go to object storage, asynchronous tasks to a message queue, and services to a container platform, forming a clear general cloud architecture.
6. Conclusion
“Rebuilding a conversational application” may look like a frontend task, but it is actually a comprehensive test of product understanding, API integration, exception handling, and security boundaries. Comparing different model and tool combinations with unified prompts, unified deliverables, and unified operating conditions turns the vague “feels good to use” into verifiable engineering conclusions. For teams, the value of this method goes beyond selection; it lies in producing a reusable acceptance baseline for conversational applications.
