Skip to content

feat: remove Ask why - #1396

Merged
frahlg merged 2 commits into
masterfrom
chore/remove-ask-why
Sep 24, 2026
Merged

frahlg merged 2 commits into
masterfrom
chore/remove-ask-why

Conversation

@frahlg

@frahlg frahlg commented Sep 24, 2026

Copy link
Copy Markdown
Member

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

  • Deleted:
    • Go: go/internal/assistant/, api_assistant*.go, state/assistant_threads.go and their tests.
    • Web: web/assistant.js and its test.
    • .github/ISSUE_TEMPLATE/ask_why.md.
  • API: the six /api/assistant/* routes, their entries in the protected-read list and the Deps.AssistantHTTP client are gone. Those routes now return 404.
  • Config: assistant: is removed from the schema, from MaskSecrets/PreserveMaskedSecrets, from validation and from config.example.yaml. A leftover block in YAML or JSON is ignored, so an old Settings page can still save.
  • Stored key: config.DropRetiredSettings runs at boot. It rewrites stored settings that still carry the assistant block, so the OpenRouter key leaves state.db and every later backup. Core logs Ask why has been removed; its settings and API key were deleted.
  • Old conversations: the assistant_threads table 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.
  • Support dump: it keeps the IPv4 and Bearer redaction that came from assistant.Redact, now in the api package. TestRedactDumpLog now also checks an IP address.
  • UI: the Plan card question box, the header offline chip and the Settings → System "Ask why" fieldset are removed. The help block is the single "Something looks wrong? Download a help report" button again, as before feat(web): Ask why explains the site and drafts a GitHub issue #1037. Asset versions are bumped.
  • Docs: the roadmap no longer links the Ask why tools.
  • Changeset: minor, because a visible feature is removed. The owner approves minors in the PR.

Evidence

  • make verify passes: all Go tests, vet, build, and the compose, container-boundary and release-workflow tests.
  • npm test passes: 627 tests under en_US.
  • New tests:
    • TestDropRetiredSettingsDeletesTheAskWhyKey: the key goes, the site is kept, and a second run does nothing.
    • TestPostConfigDropsRetiredAskWhySettings
    • a Settings test that the System tab renders no assistant fields, even for a config that still has them.
  • Upgrade on real data:
    • The published v0.135.2-beta.1 saved an OpenRouter key, /api/assistant/status reported ready: true, and the key was in state.db.
    • This branch then started on the same data. It logged the removal. The key and the assistant block were gone from state.db, the site name was kept, /api/assistant/status returned 404 and health was ok.
    • v0.135.2-beta.1 then started again on that data: health ok, no errors, Ask why off because the key is gone.
  • Rendered side by side: v0.135.2-beta.1 on :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.
    • Per AGENTS.md, a person still needs to look at it in a browser: the Plan card, the header on a phone, and Settings → System.

Overlap with open PRs

🤖 Generated with Claude Code

https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T13:39:49.584727Z 87d7739 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +223 to +224
if _, ok := saved.Config["assistant"]; !ok {
return false, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@frahlg
frahlg merged commit ba162ec into master Sep 24, 2026
16 checks passed
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