Retry edge 4xx reports, leave out uncounted events, keep the rating answer across older decks - #1934
Merged
BarganConstantin merged 4 commits intoOct 4, 2026
Conversation
Only a 400, 413 or 422 the API writes as application/problem+json is final for an event. A 403 or 404 the edge answers with itself, or a proxy's 401, says nothing about the body, so the install with its ref, the activation and the rating stay owed and go out on the existing backoff instead of being dropped.
A day saved by 3.36.x has no events count, and was read back as 0, so the first "active" after an upgrade said events "0" for a day with sessions, and a mid-day upgrade undercounted. Such a day now keeps its events unknown and the "active" leaves them out, as a peak of 0 already leaves deckMemory out.
…drop it A 3.36.x deck sharing the data dir rewrites prefs.json without the keys it does not know, report.rating among them, so the question came back after a week and a second answer was sent. The outcome is now also kept in rating.json beside prefs.json, under its install id, and merged back at start when it is further along; switching reports off removes it.
…sessions leaves The daily "active" carries the day's session, subagent and project counts, so "nothing about your sessions is reported" over-claimed, and the deck has no switch to turn the reports off. The line now says what a session contains is never reported, what the reports carry, and that AGENTS_DECK_NO_REPORTS=1 keeps them off from the first start.
Draft
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.
What changes
application/problem+jsonis final for an event. A 403 or 404 that Cloudflare answers with itself (a challenge, a rule, a tunnel being moved) or a proxy's 401 says nothing about the body, so the install with its--ref, "activated" and "rated" stay owed and go out on the existing backoff instead of being dropped. The/v1/app/*routes in ccdeck-api answer a body they will not take only withValidationProblem, andUseStatusCodePages+AddProblemDetailswrite the framework's own 400/413 as problem+json too.eventsout. A day saved by 3.36.x has no events count. It was read back as 0, so the first "active" after an upgrade said events "0" for a day that had sessions, and an upgrade during the day undercounted that day. Such a day now keeps its events unknown, through restarts too, and the "active" leaves the field out, as a peak of 0 already leavesdeckMemoryout.npx ccdeck@3.36.9) drops every key it does not know when it writes prefs.json,report.ratingamong them. The question then came back after a week and a second "rated" went out. The outcome is now also kept inrating.jsonbeside prefs.json (0600, install id + the question's state only). At start it is merged back when it is further along than prefs.json says, and only under the same install id. Switching reports off removes it.AGENTS_DECK_NO_REPORTS=1"turns them off". It now says what a session contains is never reported, what the reports carry, and that the variable keeps them off from the first start. This matches ccdeck.dev.Verification
npm run typecheck: clean.--maxWorkers=3 --minWorkers=1). After rebasing onto Network map key, heartbeat Retry-After, skipped-release tray row, and two narrow-topbar fixes #1933 I reran every reporter, usage-day and rating test file (19 files, 247 tests) and every README test (24 files, 582 tests), and all passed.reports-edge-refusal.test.ts: before the fix, a 403/404/401/409 or a non-problem+json 400 marked the install done and cleared the ref. The rating was stored as sent, and the activation as sent. Now each stays owed and goes out once the API answers. A problem+json 400/413/422 is still final.usage-day-legacy-events.test.ts: before the fix, the first "active" over a 3.36.9 save carriedevents: "0"withsessions: 12, and so did a day upgraded mid-way. Noweventsis absent. A day counted in full still says its events, zero included.rating-older-deck.test.ts: uses real files in a temp dir. Before the fix, after a 3.36.9-shaped rewrite the question was asked again, an owed answer was lost, and a twice-put-off question came back. Now none of that happens,start()restores the outcome, a different install id is ignored, and switching off removes the file.reports-refused-event.test.tsnow gives the API's refusals as problem+json.usage-day.test.tsnow pins a save with no events count toevents: null.readme-order.test.tspins the new third beat and that the old sentence is gone.updatePrefswrote over a prefs.json that 3.37 had written, in a temp home. On the fixed build the next boot did not ask again, sent no second "rated", and wrote the rating back into prefs.json.