Repository navigation
feat(core): approval gate, real OpenAI-compatible provider, cora_search tool (E4) - #18
Merged
Merged
Conversation
…ol (E4) - AllowlistApprover + Decision/Verdict types; ToolRegistry refuses Write/Destructive registration unless an approver is wired in - turn loop consults the approver before executing non-ReadOnly tools - OpenAiProvider (ureq 3, sync): env-resolved config (CORAGENT_*), scrubbed errors, structurally-leak-proof Display - CoraSearchTool: ReadOnly hybrid search via 'cora brain --json' - 47/47 tests green (9 unit + 38 integration), clippy clean
- request_body now flattens actual message entries (role/text) instead of sending a placeholder; non-message kinds and unknown roles are filtered out - cora_search subprocess wrapped in run_with_timeout: poll + kill after 30s ceiling so a hung 'cora brain' can no longer freeze the turn loop - regression tests: timeout kills 'sleep 30' in <5s, fast commands pass through, flattening preserves order and filters odd kinds/roles
…prompt - run_with_timeout now takes ownership of stdout/stderr pipes and drains them on dedicated threads; a child writing >64KB can no longer block on a full pipe and trigger a bogus timeout - system prompt becomes an explicit provider option (with_system_prompt), prepended as the first message; default is absent, never invented
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AllowlistApprover+Decision/Verdicttypes.ToolRegistrynow refuses to register Write/Destructive tools unless an approver is wired in — enforcement at the earliest possible point, stricter than the spec minimum. Turn loop consults the approver on execution:Denyproduces a durable ERROR record and aborts withApprovalRequired.OpenAiProvideroverureq3 (sync, Phase 1) for any OpenAI-compatible endpoint (OpenAI, Groq, OpenRouter, vLLM, LiteLLM). Config viaCORAGENT_*env vars. API key lives only in the outboundAuthorizationheader:scrub()strips it from errors,safe_description()never includes it, and a test proves the key cannot appear in any Display/error path.cora_searchtool: ReadOnly search over the project symbol index viacora brain <query> --json --limit. Subprocess wrapped inrun_with_timeout(30s ceiling, poll + kill) with stdout/stderr drained on dedicated reader threads so a >64KB output can't deadlock the pipe and a hung CLI can't freeze the turn loop.request_bodyflattens actual message entries (role/text) in order, filters non-message kinds and unknown roles. Optional system prompt viawith_system_prompt— explicit opt-in, never invented by the provider.Why
Closes #4 (E4). Three acceptance criteria:
sleep 30kill test).Testing