feat: remove Ask why - #1396
feat: remove Ask why#1396
Conversation
FTW's core is the local EMS and planner. Ask why sent the site's help report to OpenRouter and chatted about it; that belongs outside Core, in whatever agent the owner chooses, reading the same help report and API. The help report, planner reasons and diagnostics stay. Removes the assistant package, the /api/assistant/* routes, the Settings fieldset, the Plan card question box, the header chip, the ask_why issue template and the config schema block. The support dump keeps its IPv4 and Bearer redaction, now in the api package. Stored state: on start, Core rewrites stored settings that still carry the assistant block, so the OpenRouter key leaves state.db and later backups. The assistant_threads table stays, unused, like the Home Link tables; the state schema version does not change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87d7739b40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if _, ok := saved.Config["assistant"]; !ok { | ||
| return false, nil |
There was a problem hiding this comment.
Remove the retired key from the retained YAML seed
When an upgraded installation's original config.yaml contains the assistant block, this migration only inspects and rewrites the SQLite configuration document. InitializeStorage/recordSettingsDatabase deliberately preserve the original YAML while adding config_database, so the OpenRouter key remains verbatim in config.yaml even though startup may report that it was deleted. Prune the retired block from that retained seed as well so removing the setting actually removes its stored credential.
AGENTS.md reference: AGENTS.md:L20-L21
Useful? React with 👍 / 👎.
Why
Owner decision: Ask why, the in-app LLM assistant on OpenRouter, is no longer part of FTW. Core is the local EMS and planner. An owner who wants an AI explanation points their own agent at the same help report and API. The deterministic explanations stay: help report, support dump, planner reasons,
/api/mpc/diagnose, charging reasons and the savings breakdown.What
go/internal/assistant/,api_assistant*.go,state/assistant_threads.goand their tests.web/assistant.jsand its test..github/ISSUE_TEMPLATE/ask_why.md./api/assistant/*routes, their entries in the protected-read list and theDeps.AssistantHTTPclient are gone. Those routes now return 404.assistant:is removed from the schema, fromMaskSecrets/PreserveMaskedSecrets, from validation and fromconfig.example.yaml. A leftover block in YAML or JSON is ignored, so an old Settings page can still save.config.DropRetiredSettingsruns at boot. It rewrites stored settings that still carry theassistantblock, so the OpenRouter key leaves state.db and every later backup. Core logsAsk why has been removed; its settings and API key were deleted.assistant_threadstable stays, unused, with the same "do not reuse" note as the Home Link tables. The state schema version stays at 7, so the native schema guard still passes and a rollback works. An older Core simply finds the table.assistant.Redact, now in the api package.TestRedactDumpLognow also checks an IP address.minor, because a visible feature is removed. The owner approves minors in the PR.Evidence
make verifypasses: all Go tests, vet, build, and the compose, container-boundary and release-workflow tests.npm testpasses: 627 tests underen_US.TestDropRetiredSettingsDeletesTheAskWhyKey: the key goes, the site is kept, and a second run does nothing.TestPostConfigDropsRetiredAskWhySettingsv0.135.2-beta.1saved an OpenRouter key,/api/assistant/statusreportedready: true, and the key was in state.db.assistantblock were gone from state.db, the site name was kept,/api/assistant/statusreturned 404 and health was ok.v0.135.2-beta.1then started again on that data: health ok, no errors, Ask why off because the key is gone.v0.135.2-beta.1on :8091 and this branch on :8092, same simulated site, Plan view at 1280 px. The question box and the "Ask why" link are gone, and the help report button and its text read as before feat(web): Ask why explains the site and drafts a GitHub issue #1037.Overlap with open PRs
go/internal/assistant, so it no longer fits.GET /api/loadpoints/{id}/evidenceendpoint can survive without its Ask why tool parts.system.js), feat(modbus): share one TCP session per device and proxy it #1003 (index.html,config.go) and feat(prices): static / time-of-use tariff so planning works outside Europe #1051 (a context line next toc.Assistant.Validate()). Expect small rebases.🤖 Generated with Claude Code
https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7