This project involves fixing a bug in an agent's approval flow within a Web UI chat. The issue is that after a page refresh, the approval status reverts to 'Approval requested' despite being correctly processed and stored in the database. The fix requires ensuring the post-approval response is persisted and displayed correctly.
Someone already won this. Here's what they did — and whether you can win the same.
A starter prompt for Claude Code, what you'll need, and how to reach them.
You are an expert developer contributing to the 'archestra-ai/archestra' project. Your task is to implement a fix for issue #4030, 'Approval flow is broken in Web UI Chat'. The core problem is that after an agent's approval request is processed and stored, a page refresh makes the UI revert to 'Approval requested', and subsequent clicks cause errors because the database already holds the final status, but the post-approval response is not persisted. Your goal is to: 1. **Reproduce the bug:** Set up the Archestra development environment and confirm the described behavior. 2. **Analyze the current approval flow:** Identify where the UI state is managed and how approval decisions and subsequent agent responses are handled on the frontend and persisted to the backend/database. 3. **Implement Persistence:** Modify the backend logic to ensure that the agent's *response* (the message rendered after approval or decline) is stored in the database along with the `approved`/`declined` status. 4. **Update UI Refresh Logic:** Adjust the frontend (Web UI) to correctly retrieve both the final approval status and the associated agent response from the database upon page refresh and display them, preventing the 'Approval requested' reversion. 5. **Error Handling:** Ensure that clicking Approve/Decline again on an already resolved request gracefully handles the situation (e.g., by disabling buttons or showing a relevant message) rather than throwing an error. Use the project's existing stack for the frontend (likely React/TypeScript) and backend (likely Python/FastAPI or similar). Focus on a clean, maintainable solution that integrates well with the existing codebase. Provide detailed steps, code snippets, and verification instructions.
Developers building MCP servers or AI agent evaluation tools could be interested in this fix as it demonstrates expertise in agent approval flows and robust UI/backend integration.
WON bounty — solved by @mbachaud in https://github.com/archestra-ai/archestra/pull/4827. Study the PR, then find the same pattern as an OPEN bounty. When an agent requires approval to use an MCP tool, both Approve/Decline buttons work correctly, and the agent renders the corresponding response. However, after a page refresh, the response disappears and the approval form shows **"Approval requested"** again. Clicking either button again then renders an error. In the database, the request is stored with the final `approved`/`declined` state, which is why clicking Approve/Decline again results in an error. At the same time, the response that was rendered after the approval decision is not stored in the database - only the approval request itself with the final status. --- <!-- archestra-banner:v1 --> <a href="https://archestra.ai/contributor-onboard" rel="nofollow noreferrer noopener" target="_blank"> <img alt="Image" src="https://raw.githubusercontent.com/archestra-ai/archestra/main/docs/assets/archestra-contributor-banner.webp"/> </a>
Standard for any dev work.
Standard for backend development and AI tools.
Required for the frontend (React/TypeScript).
Likely used for local environment setup; common for dev.
Archestra's backend uses PostgreSQL.
New: FastAPI for API development; focus on data models and endpoints - ~1 day.
Learn it: Search getting-started ↗
Standard frontend stack for Lumivara operator.
Submit a Pull Request to the `archestra-ai/archestra` repository, linking to the original issue #4030.
“I've identified the root cause of the approval flow bug in the Web UI Chat (#4030) and have a working solution ready. I'll open a PR that correctly persists the agent's post-approval response and ensures the UI reflects the true state after a refresh, without errors.”
Open the original ↗