Files
FinalToken/.agents/mind/gotchas.md
T
Florian Schmidt f108226f04
agent-review agent review: pass
docs: record v1 lessons and open items in the project mind
Adds the pitfalls v1 hit (GUI-host output encoding, init-only JSON
defaults, Windows replace vs. readers, Stream Deck environment
inheritance, the app/CLI name clash, plugin version bumps, missing local
midnights) and the checks and review notes still open after PR #2.

Refs #3
2026-10-14 22:12:17 +02:00

2.4 KiB

Gotchas

  • [2026-10-14] claude -p "/usage" writes a transcript into the working directory's project folder unless --no-session-persistence is passed; that transcript would show up in Claude token history.
  • [2026-10-14] Git Bash rewrites an argument that starts with / (/usage becomes C:/Program Files/Git/usage). Run CLI probes from PowerShell, or set MSYS_NO_PATHCONV=1. The app itself starts processes with an argument list, so it is not affected.
  • [2026-10-14] A GUI-subsystem host (WinExe) has no console and no console code page, so .NET decoded child output with code page 0 and Claude's · separators broke the /usage parser: Claude was "unavailable" in the app but fine in the CLI. Child pipes are always UTF-8 and every child gets its own handles (D6). Test process code from a GUI host (tests/FinalToken.ProcessHost), not only from a console.
  • [2026-10-14] With source-generated System.Text.Json, an init-only property missing from the JSON gets default, not its initializer. A partial settings.json then failed validation and reset every setting. Types read back from disk use settable properties so defaults survive (Core AGENTS.md). Test with partial files, not only round trips.
  • [2026-10-14] On Windows, replacing a file fails while another process holds it open without delete sharing. Readers of atomically replaced files open them with FileShare.ReadWrite | FileShare.Delete, and the replace retries briefly (D5).
  • [2026-10-14] A Stream Deck host started by the app (or a test harness) inherits that process's environment, FINALTOKEN_DATA_DIR included, and so does the plugin. To return a machine to normal after a test, restart Stream Deck from Explorer: explorer.exe "C:\Program Files\Elgato\StreamDeck\StreamDeck.exe".
  • [2026-10-14] Windows file names ignore case: FinalToken.exe (app) and finaltoken.exe would collide in one folder, so the CLI is finaltoken-cli everywhere.
  • [2026-10-14] The installer updates the plugin only when the shipped manifest Version is higher (D11). tools/publish.py stamps it from <Version> in Directory.Build.props; bump that for every release that changes the plugin or Core, or installed plugins stay stale.
  • [2026-10-14] Converting a local midnight with TimeZoneInfo.ConvertTimeToUtc throws where midnight does not exist (Cairo, Santiago, Beirut at DST changes). Use CalendarDays for every local day boundary.

Archive