Repository navigation
feat(models): secfoo models, pre-run validation, per-skill defaults, and dashboard/cost display (#111) - #209
Merged
vsn411 merged 5 commits intoNov 29, 2026
Conversation
…ults, and model spend/UI (secfoo-com#111)
SriRamkunamsetty
force-pushed
the
feat/models-discovery-111
branch
from
November 29, 2026 02:12
2072e87 to
cff8b1a
Compare
… config set config set wrote config.toml with write_text (0644 under a default umask); the file can hold MCP bearer tokens, so write it with write_private_text (0600, atomic, symlink-safe) like the rest of secfoo. A [[mcp_servers]] header was not recognised as a table boundary, so a key appended to the table above it could land inside the last MCP server entry instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
|
Thanks, and welcome! This covers #111 end to end:
I pushed one commit (d90e842) with two small fixes in
Once a maintainer approves the workflow run and CI is green, this is ready to merge. |
# Conflicts: # docs/agents.md # src/secfoo/agents/copilot.py # src/secfoo/settings.py
CodeQL flagged py/unsafe-cyclic-import: base.py imported ModelInfo at runtime while models.py imports base. base.py only uses it in annotations, so import it under TYPE_CHECKING. Also explain the empty except around the cache write, and match provider URLs by prefix in the test fake. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CodeQL still reported the base <-> models cycle with the import under TYPE_CHECKING. ModelInfo now lives in a module both import, so there is no cycle at all. agents.models still exports it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
|
Merged, thank you! 🎉 Before merging, I pushed a few fixes to your branch:
CI and CodeQL were green. |
Leaderboard update
SriRamkunamsetty now has 16 points (rank #7). 9 more to reach Bronze. |
vsn411
added a commit
to saryeljaramany/secfoo
that referenced
this pull request
Nov 29, 2026
Resolve the docs conflicts with secfoo-com#205 (api MCP tool loop), secfoo-com#209 (Models column) and secfoo-com#214: keep both the api and Codex MCP text. Also drop the header row that the secfoo-com#209 merge duplicated in docs/agents.md, and say 'remove the entry, then run sync again' for key rotation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #111
What does this change, and why?
Until now,
--modeland[agents.<id>].modelrequired callers to guess exact model IDs (typos only failed minutes later in the agent CLI),agyanddevinsilently ignored--modelwith a warning, per-skill model defaults were unsupported, andruns.modelwas stored without being surfaced in CLI commands,secfoo cost, or the dashboard.This PR adds:
secfoo models [--agent ID] [--refresh] [--json]):ModelInfo, 24-hour~/.secfoo/models.jsoncache (fingerprinted by active key env vars and binary path), andlist_models()across every adapter (clilisting -> provider REST API ->litellm.model_costfiltered by present keys forapi-> curated fallback withverified_at).secfoo run --model Xvalidates against live model lists before invoking the agent, failing fast with up to 3difflibsuggestions andsecfoo models --agent <id>.--model-uncheckedbypasses; curated-only lists warn rather than blocking.agyanddevinnow raiseUnsupportedModelError/ exit1on explicit model selection instead of warning and ignoring.secfoo config set/get:[skills.<skill-id>].modeland[agents.<id>.skills.<skill-id>].modelinsettings.pywith precedence:--model>agents.<id>.skills.<skill>.model>skills.<skill>.model>agents.<id>.model> CLI default.secfoo config setandsecfoo config getwith comment-preserving TOML updates and validation viaload_config().modeleverywhere (CLI,cost,web):Modelcolumn tosecfoo list, model label tosecfoo show,"model"per run insecfoo run --json, andsecfoo cost --by model.modeltorun_detail.html,project.html,assessments/detail.html,overview.htmlrecent runs, and aBy agent/By modelsegmented toggle on the overview AI spend card (/?spend=model).docs/agents.mdwith aModelscolumn anddocs/REFERENCE.mdwith precedence,secfoo models,secfoo config set/get, andsecfoo cost --by model.Testing
ruff check .passes (0 errors)bandit -c .bandit -ll -r src/secfoopasses (0 medium/high issues)pip-audit --skip-editablepasses (0 known vulnerabilities)python -m secfoo.cli sensor conformance -- python -m secfoo.sensor -m secfoo.runtime.conformance.sample_apppasses (6/6)python -m secfoo.cli skills validate examples/skillspasses (2 valid)git merge-tree --write-tree HEAD upstream/maincleanly merges with 0 conflictstests/test_agents/test_models.py(37 tests intest_models.py, 384 passed across agent/cli/settings/cost/runner/docs/web suites, 715 passed across storage/report/runtime/sensor/skills/targets; note:lxmlC-extension tests (test_context_brief.py,test_docext.py, 5docxupload cases) are blocked locally by Windows App Control policy, not code failures — CI runners will verify those).