AI Agent Workflow for Conversational Web Pages: Engineering Delivery and Acceptance Practices
This article examines how AI agents can build conversational web pages within a compliant, authorized scope, moving beyond simple page generation to a complete engineering delivery process. It defines three deliverables—product documentation, a faithful reconstruction, and a problem-driven optimized version—and discusses functional structure, execution environments, two-stage integration, message state management, dynamic layout, and a four-layer acceptance system. The goal is to help developers and teams establish an evidence-based workflow for reliable, maintainable, and secure conversational web applications.
1. From “Generating a Web Page” to Complete Engineering Delivery
Asking an AI agent to develop a conversational web page based on an existing one may appear to be a UI reconstruction task. In practice, it involves product analysis, frontend implementation, backend integration, data management, and quality verification.
In the original practice, a valuable task design requires three deliverables at the same time: a product functional document with a structure diagram, a faithful reconstruction of the web page, and an optimized version redesigned around usage needs. This design separates “understanding the product,” “implementing the product,” and “improving the product,” and avoids evaluating the entire development process from a single screenshot.
However, it must be clear that being able to browse public pages or read API documentation does not mean the agent has mastered the server-side implementation, let alone reproduced the underlying model. From an engineering perspective, what can be rebuilt is the observable interface and interactions, and what can be integrated is the service capability within an authorized scope. Undisclosed data structures, permission policies, and internal scheduling mechanisms cannot be deterministically inferred from surface behavior.
Therefore, the goal discussed in this article is how to enable an AI agent, within a compliant and authorized scope, to build conversational web pages with clear functions, reliable interactions, and maintainability, rather than to reproduce an unknown underlying system.
2. Task Breakdown: Three Deliverables Must Be Defined Separately
2.1 Product Report: Extract Functional Contracts from Page Elements
A product report cannot simply list “sidebar, input box, send button.” These are interface elements, not complete functions.
Take message sending as an example. The following questions need to be answered:
- Is submission allowed when the input is empty?
- Can the user send another message while generation is in progress?
- Can the user abort generation?
- How should retries work after a request fails?
- Do historical messages participate in subsequent requests?
- How should an unfinished answer be displayed after the page is refreshed?
These questions together form a functional contract. The product report should at least record functional entry points, preconditions, operation steps, normal results, exception feedback, and open items.
For functions that cannot actually be verified, they should be explicitly marked as “unverified” or “requires additional permission.” Speculation must not be written as fact. When sharing links are involved, creator access and unauthenticated access should also be distinguished. A successful visit in the same browser does not prove that public sharing permissions have been correctly implemented.
2.2 Faithful Reconstruction: Prioritize Behavioral and Layout Consistency
The goal of the faithful reconstruction is to reduce unsupported design liberties. Developers should first record page dimensions, regional relationships, interaction states, and responsive behavior before implementation.
On desktop, attention should be paid to the navigation area, message width, input area position, and long-content layout. On mobile, verification should focus on the relationship among soft keyboard pop-up, input box growth, bottom action area, and page scrolling.
“Looking similar at a certain size” and “providing a consistent experience across devices” are two different outcomes. The latter must be confirmed through multiple viewports, multiple content lengths, and real interaction tests.
2.3 Optimized Version: Every Change Must Correspond to a Specific Problem
The optimized version should not become a pile of features. A more reasonable approach is to establish a closed loop of “problem—change—verification.”
For example:
- If historical conversations are hard to locate, search and grouping can be added, but their retrieval scope and empty-result prompts must be verified.
- If long answers are difficult to read, a table of contents and paragraph positioning can be added, but short answers must not be disturbed by extra controls.
- If users can only re-enter text after a failure, preserving input and retry capabilities can be provided, but duplicate submissions must be prevented.
- If multi-turn tasks are hard to track, task status indicators can be added, but unauthorized internal reasoning content must not be exposed.
Each optimization should explain the usage scenario, benefit, implementation cost, and potential side effects.
3. Establish the Functional Structure Before Coding
A conversational web page can be organized according to the following structure:
Conversational application├── Session management│ ├── New session│ ├── History list│ ├── Rename and delete│ └── Search and locate├── Message interaction│ ├── Input and send│ ├── Progressive display│ ├── Abort generation│ └── Retry after failure├── Content display│ ├── Text and code│ ├── Copy operation│ └── Long-content navigation├── Sharing and permissions│ ├── Share creation│ ├── Access control│ └── Revocation and expiration└── System safeguards├── Identity authentication├── Server-side credential management├── Request limits└── Logging and monitoring
This is a generic candidate structure and does not mean that every target page has all of these functions. In an actual project, items should be classified as “observed,” “needs confirmation,” and “proposed addition” to prevent existing functions from being mixed with optimization suggestions.
A requirement traceability table can further link requirement IDs to page components, service interfaces, and test cases. For example, “abort generation” not only corresponds to a button, but also involves frontend request cancellation, server-side processing termination, retention of received text, and session state recovery.
This traceability relationship helps developers identify false delivery, where “the interface exists but the behavior is not complete.”
4. Analyze the Agent Execution Environment Separately from Model Capabilities
The development result of an AI agent is not determined by the model alone. Whether the execution environment supports browsing pages, reading files, running programs, observing errors, and executing tests also affects delivery quality.
A typical loop is:
Observe the page → establish requirements → write the implementation → start the application → operate and verify → analyze problems → modify and regress.
If only a page description is provided without runtime feedback, the agent may generate code that is structurally complete but not actually usable. Conversely, even with sufficient tool permissions, an unclear task objective can lead to repeated exploration and irrelevant changes.
To compare different execution approaches, the following should be standardized:
- Initial code and working directory;
- Page access and service invocation permissions;
- Task description and supplementary information;
- Time and resource budget;
- Available tool scope;
- Acceptance cases and delivery format.
Testing should also record each modification and verification process, rather than saving only the final screenshot. Good performance in a single task is not enough to prove a general advantage; evaluation should be based on specific artifacts and observable behavior.
5. Two-Stage Execution: Complete the Structure First, Then Verify Real Calls
Dividing the task into a requirements stage and a service integration stage helps separate interface development from integration debugging.
The first stage should complete the product report, page structure, interaction states, and mock data flow. In the second stage, after authorized configuration is obtained, the real service should be integrated and the complete chain re-verified.
It is important to note that adding credentials is not simply replacing a string. It introduces new error types, such as authentication failure, access restrictions, response interruption, and service timeout.
For security, real keys should not be written into conversation prompts, browser code, screenshots, or logs. A more robust approach is to provide credentials through controlled server-side configuration, so the agent knows where the configuration is located and how it is used, rather than directly exposing sensitive content.
A recommended generic invocation structure is:
Browser↓ user requestApplication server├── identity and permission checks├── input validation and request limits├── server-side credential retrieval└── inference service call↓ response forwardingBrowser displays result
The frontend handles interaction, while the application server handles credential protection and access governance. The boundary between the two should be determined before development.
6. Core Implementation: Constrain the Message Lifecycle with a State Machine
The most common problem in conversational features is not button color, but chaotic asynchronous state.
It is recommended to divide a message request into the following states:
Ready to send → Submitted → Receiving → Completed├── Aborted└── Failed
Each state should have corresponding interface and operation constraints. During receiving, an abort entry can be displayed; after failure, retry can be allowed; when aborted, received content should be retained and the answer clearly marked as incomplete.
At the same time, “stop displaying” and “stop requesting” must be distinguished. If the frontend only hides the loading state, the server may still continue processing. If the underlying call cannot be terminated immediately, the boundary of cancellation capability should also be clearly stated.
Asynchronous writes must be bound to session identifiers and request identifiers. Otherwise, after the user switches sessions, content returned by an old request may be incorrectly written to the current page. Repeated send clicks, rapid session switching, and retrying old messages are all race scenarios that should be tested carefully.
Progressive output also involves content parsing. Code blocks, lists, and other rich-text structures may be temporarily incomplete during reception, so rendering logic must tolerate intermediate states. External content must not be inserted directly as executable page content; dangerous tags, script behavior, and unsafe links must be restricted.
7. Interface Reconstruction Focuses on Dynamic Layout
Static screenshots cannot cover layout changes in real use. Input content growth, soft keyboard appearance, sidebar expansion, and long-answer appending can all change the page structure.
Mobile verification should especially check:
- Whether the input box is always visible and operable.
- Whether the send and abort buttons are covered after the keyboard appears.
- Whether multi-line input has a reasonable maximum height.
- Whether new content arrival interferes with the user reading historical messages.
- Whether horizontally wide content causes the entire page to overflow.
Auto-scroll should follow user intent: when the user is near the bottom, new content can be followed; when the user actively scrolls up, forced scrolling should be paused, and an entry point to return to the latest position should be provided.
Reconstruction quality should not be judged only visually. Keyboard operation, focus order, button labels, and status prompts are also usability requirements.
8. Acceptance System: Move from “It Runs” to “It Can Be Delivered”
Acceptance is recommended to be divided into four layers.
8.1 Static Checks
Check whether the project can build, whether dependencies and configurations are complete, whether sensitive information is leaked, and whether there are obvious type or syntax errors. This layer can only prove that the project has a basis for running.
8.2 Normal Functional Testing
Cover actually implemented functions such as new session creation, message sending, continuous conversation, aborting generation, history restoration, and delete confirmation. Each test must have a clear expectation; “the page did not report an error” is not sufficient for passing.
8.3 Exception and Boundary Testing
Focus on empty input, extremely long input, network disconnection, authentication failure, response interruption, duplicate submission, session switching, and page refresh.
Acceptance should check recovery capability after failure: whether input is preserved, whether partial answers are visible, whether errors are understandable, and whether retries produce duplicate messages.
8.4 Experience and Security Testing
Check layout at different window sizes and touch environments; verify sharing permissions using an independent access environment; check whether logs contain keys or complete sensitive conversations; and confirm whether deletion and revocation operations truly affect subsequent access.
Each result can include test steps, screenshots, log summaries, and known limitations. An evidence chain is more suitable as a delivery basis than subjective evaluation.
9. Delivery Checklist for Teams
A maintainable project should ultimately deliver at least:
- Product requirements and functional structure documents;
- Functional boundary descriptions for the faithful and optimized versions;
- Source code, configuration templates, and startup instructions;
- Data persistence and migration documentation;
- Test cases and execution results;
- Known issues and unverified items;
- Credential management and permission documentation;
- Priorities for subsequent iterations.
If the system already serves real users, backup and recovery, capacity assessment, and runtime monitoring should also be added. Metrics can include request success rate, response latency, exception distribution, and cancellation results, but specific values must not be fabricated without actual measurement.
10. Conclusion: Evaluate the Delivery Loop, Not Just Generation Speed
AI agents can significantly reduce the cost of prototype development, but code generation is only part of the delivery process.
A truly reliable process is to first translate observable behavior into requirements, then implement them with clear architecture and state management, and subsequently establish an evidence chain through real calls, exception scenarios, and independent permission verification.
The accuracy of the product report, consistency of page behavior, completeness of security boundaries, and the ability to regress after discovering problems together determine whether a conversational web page is worth delivering. For developers and enterprise teams, this has more practical value than single-run generation speed or the visual similarity of a static interface.
