Repository navigation
Feat(agents): Document adapter extensibility, add Claude adapter cost tracking - #13
Closed
karthickmk2001 wants to merge 3 commits into
Closed
karthickmk2001 wants to merge 3 commits into
karthickmk2001 wants to merge 3 commits into
Conversation
Contributors had no documented path to extend secfoo with a new agent CLI, even though the AgentAdapter base class + registry.py already supported it cleanly. Adds a CONTRIBUTING.md section (mirroring the existing skill-authoring one) and a README pointer to it. Co-Authored-By: Claude Sonnet 5 <[email protected]>
secfoo cost previously only reported spend for the built-in secfoo/ LangGraph agent, silently leaving cost_usd NULL for every run through claude/cursor/antigravity/gemini even though the README implied cost was tracked per run in general. Adds an extract_cost() hook to AgentAdapter, wired into run()'s success path alongside the existing extract_report() hook. Claude Code reports its own total_cost_usd in --output-format json, so ClaudeAdapter now parses and returns it -- a real CLI-reported figure, not an estimate. Cursor, Antigravity, and Gemini CLI don't report a cost figure in their output, so those adapters intentionally leave cost_usd unset (documented inline) rather than guess from token counts against a pricing table we'd have to keep current. README and CONTRIBUTING.md updated to describe the actual coverage. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Collaborator
Author
|
Closing this. SecFoo development has moved to the private repository, and cost tracking has since been implemented there (per-run AI cost tracking, plus CI controls: --fail-on, --max-cost, --json and portal cost ingest). No further work will happen on this branch. |
3 tasks done
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.
Summary
AgentAdapter, theADAPTERSregistry, and the optionalextract_report()/extract_cost()hooks) in CONTRIBUTING.md, with a pointer from README's "Bring your own agent" bullet.secfoo cost) beyond the built-insecfoo/LangGraph agent: adds anextract_cost()hook toAgentAdapterand wires it up for theclaudeadapter using Claude Code's owntotal_cost_usdfield from--output-format json.Test plan
pytest tests/test_agents— 33/33 passing (7 new tests coveringextract_costbehavior acrossclaude,cursor,gemini,antigravity)ruff checkclean on all files touched in this PRtest_runner.py, file-permission checks intest_cloud.py, unrelated dashboard tests)