fix: clear transcript and prompt state on disconnect; document status stats fields#39
Open
Swissola wants to merge 1 commit into
Open
fix: clear transcript and prompt state on disconnect; document status stats fields#39Swissola wants to merge 1 commit into
Swissola wants to merge 1 commit into
Conversation
…s fields data.h: when the bridge connection times out, nLines and the promptId/Tool/Hint fields were left populated from the last live snapshot. A reconnect within the same session would show stale transcript lines and, if the device happened to echo the old promptId, a ghost approval could be sent. Clear them in the disconnect branch alongside the session counters. REFERENCE.md: the stats object in the status response had no field definitions. Add a table documenting appr, deny, vel, nap, and lvl so implementors know what each counter means without reading firmware source. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rushabh91
added a commit
to rushabh91/claude-desktop-buddy
that referenced
this pull request
May 30, 2026
…ropics#38 anthropics#39 anthropics#31 anthropics#25 anthropics#27 anthropics#26 anthropics#24 anthropics#33 anthropics#34 anthropics#32 anthropics#15) Bug fixes: - ble_bridge.cpp: replace volatile rxHead/rxTail with portMUX spinlock to fix dual-core memory-barrier race between BLE Core-0 callbacks and main-loop Core-1 (anthropics#40) - data.h: skip oldest entries when bridge sends >16, always show newest (anthropics#38 + anthropics#33) - data.h: clear nLines/promptId/promptTool/promptHint on disconnect so reconnect shows a clean slate instead of stale transcript and ghost approval prompt (anthropics#39) - xfer.h: reject file command with ok:false when path would overflow the 80-byte buffer instead of silently truncating to a mangled LittleFS path (anthropics#31) - stats.h: widen approvals/denials to uint32_t (uint16_t overflows at ~65k, silently corrupting mood tier); update NVS keys to getUInt/putUInt (anthropics#25) UX fixes: - main.cpp: remove msgScroll=0 reset on lineGen change — scroll position is now preserved while new transcript lines arrive; maxBack clamp still handles bounds (anthropics#26) - main.cpp: auto-dismiss stale approval prompt after 5 minutes so a crashed bridge never leaves the panel stuck; promptTimedOut flag survives bridge re-sends (anthropics#27) - stats.h + main.cpp: persist brightness level in NVS (s_brt); load and apply after settingsLoad() in setup(); save via settingsSave() when cycled in menu (anthropics#24) Enhancements: - data.h: grow TamaState.lines from 8 to 16 entries (+736 bytes RAM) (anthropics#33) - main.cpp: show BT/USB connection badge in transcript corner when not scrolled (anthropics#34) - main.cpp: replace elapsed-time header on approval prompt with 5-minute countdown; turns red below 30s; shares PROMPT_TIMEOUT_MS with the auto-dismiss logic (anthropics#32) - main.cpp: add ascending two-note celebrate chime (2000→2800 Hz) on P_CELEBRATE state entry; edge-triggered once per window; gated by settings().sound (anthropics#15) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problem
Two small correctness issues found while reading the firmware:
1. Stale state on reconnect (
data.h)When
dataConnected()returns false the disconnect branch zeroes the sessioncounters but leaves
nLines,promptId,promptTool, andpromptHintwiththeir last live values. On a quick reconnect within the same run the UI renders
stale transcript lines, and if the device happens to echo the old
promptIdbefore receiving a fresh snapshot it sends a ghost approval/denial.
Fix: clear all four fields alongside the session counters in the disconnect
branch.
2. Undocumented
statsfields in status response (REFERENCE.md)The status response JSON example includes
{ "appr": 42, "deny": 3, "vel": 8, "nap": 12, "lvl": 5 }but the document has no table explaining what any of these mean. Implementors have to read firmware source to understand them.Fix: add a
statsfield table below the status response block.Changes
src/data.h— +1 line in disconnect branchREFERENCE.md— +10 lines documentingstatsobject fieldsTest plan
statstable for correctness againstxfer.hstatus handler🤖 Generated with Claude Code