Skip to content

refactor(constants): create api_constants.py — centralize API path strings (#3531)#3540

Merged
mrveiss merged 2 commits intoDev_new_guifrom
issue-3531
Apr 5, 2026
Merged

refactor(constants): create api_constants.py — centralize API path strings (#3531)#3540
mrveiss merged 2 commits intoDev_new_guifrom
issue-3531

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Apr 5, 2026

Summary

Creates autobot-backend/constants/api_constants.py and replaces all hardcoded /health, /api/health, and /api/generate path strings across 11 files.

New file: constants/api_constants.py

PATH_HEALTH          = "/health"
PATH_API_HEALTH      = "/api/health"
PATH_OLLAMA_GENERATE = "/api/generate"
PATH_OLLAMA_CHAT     = "/api/chat"
PATH_OLLAMA_TAGS     = "/api/tags"

Files updated

File Change
constants/threshold_constants.py Replaced inline string defs with imports from api_constants
middleware/service_auth_enforcement.py EXEMPT_PATHS list entries
middleware/tracing_middleware.py EXCLUDED_PATHS set entries
utils/service_registry.py ServiceConfig default + 5 get_default_services() entries
utils/service_discovery.py ServiceEndpoint default + 4 _register_* assignments
utils/hardware_metrics.py One "path" dict entry
api/api_benchmarks.py 3 URL construction occurrences
chat_workflow/llm_handler.py Ollama generate endpoint paths
agents/overseer/overseer_agent.py 3 occurrences in _get_ollama_endpoint()
agents/overseer/command_explanation_service.py 3 occurrences in _get_ollama_endpoint()
utils/connection_utils.py .replace() call for tags discovery

Closes #3531

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@mrveiss mrveiss merged commit 1bec663 into Dev_new_gui Apr 5, 2026
4 of 5 checks passed
@mrveiss mrveiss deleted the issue-3531 branch April 5, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant