Cognito Agent Phase 1: Agent Loop + Tool Execution#3
Conversation
- Added SSE endpoint `POST /api/agent/loop` for agent execution. - Implemented core agent loop with tool support. - Added four initial tools: `read`, `write`, `edit`, and `bash`. - Implemented security measures: `ProjectTrustStore`, `PROTECTED_FILES`, and `sudo` rejection. - Enhanced `BackendClient` and `BackendRouter` with tool-calling support and failover. - Refactored uncertainty calculation to `app/core/uncertainty.py`. - Added unit tests for tools, trust store, and agent loop. - Updated documentation and added `AGENTS.md`. Co-authored-by: Axlfc <14998495+Axlfc@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR implements Phase 1 of the Cognito Agent. It adds a new Agent Loop capable of executing tools with strict security guarantees.
Key changes:
POST /api/agent/loop(SSE).read: Reads files within the workspace.write: Writes/overwrites files (requires trust, enforces protected files).edit: Search-and-replace editing (requires trust, enforces protected files).bash: Executes shell commands (requires trust, rejects sudo, implements 30s-120s timeout).ProjectTrustStore: Persists repository-level trust status in~/.cognito/trust.json.PROTECTED_FILES: Prevents modification of critical files likeauth.js.cwd./api/chatfor native tool calling support.PR created automatically by Jules for task 17852941190475397888 started by @Axlfc