amicode: GET /amicode/traces — reader for the turn-level trace spans - #9
Closed
Rchari1 wants to merge 10 commits into
Closed
amicode: GET /amicode/traces — reader for the turn-level trace spans#9Rchari1 wants to merge 10 commits into
Rchari1 wants to merge 10 commits into
Conversation
…ion-lookup.ts — shared by the About-You card and the onboarding wizard; card keeps debounce/sequencing/race guards Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… about-you with live institution/logo lookup → profile preview + open chat); saves through POST /amicode/profile so the home page autofills affiliation + logo; shows exactly once (fresh profile, dismiss remembered) + tests Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… the starter chips (Open chat owns 'start something'); PDFs upload via POST /amicode/library into ~/.amico/library (sanitized basename, %PDF- magic check, 30MB cap), GET lists newest-first; 'Discuss latest →' hands the agent the paper path + tests Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…jects On a fresh browser profile against a bare `opencode serve`, the home page's primary CTA (Meet-Amico card / "Open chat") did nothing: the persisted client-side project list is empty, so startWithPrompt fell through to openNewSession(), which needs the same newSessionProject() that just came back empty and silently returns. Fall back to the focused server's own working directory, synced from GET /path (.directory; "" until loaded, so the guard holds). Open and touch it as a project — self-healing: the home page tracks it from then on — and start the draft with the prompt preserved. Deliberately not sync.data.project: the server's "global" record has worktree "/". Regression spec drives the real UI against a mocked server with no localStorage seed; verified failing on the unfixed code and passing with the fix. tsgo -b clean; bun test:unit 376 pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
amicode(home): fix silent dead-end on 'Open chat' with no tracked projects
…' (upload PDFs between about-you and the finish; ✓-list of uploads, continue-without-papers path; step skipped when upload isn't wired); home Library card stays; shared fileToBase64 util Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mo udd hit exactly this) + trunk Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… demoted to the quiet secondary — the autofilled home is the payoff shot Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
amicode: first-run onboarding wizard — welcome UI that autofills home-page affiliation + logo
…n-level spans (index: per-session counts/tokens/errors/model-ms; ?session= bounded span read); envelope mirrored from the amicode writer (change both in one change-set) + tests Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jack-champagne
force-pushed
the
local/amicode
branch
from
July 20, 2026 12:59
c05d2e3 to
e9b6951
Compare
Member
|
Closing as stale — 293 commits behind, and a rebase is more expensive than a fresh port. To be clear about why: this was not superseded. I checked, and Tracked in #77 so it doesn't get lost. The amicode-side counterpart harmoniqs/amicode#106 is still open and green. Branch |
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.
Turn-level traces, local-first (reader half; pairs with harmoniqs/amicode
rchari/traces— the plugin writer).What
GET /amicode/traces— index: one row per session (span/model/tool counts, error count, input + cache-read token totals, total model ms, first/last ts), newest first.GET /amicode/traces?session=<id>&limit=— that session's spans, bounded (≤5000), newest-last, session id validated (no traversal). Same never-reject discipline as problems.ts; malformed lines skipped (append-only stream).Contract
The span envelope is defined by the WRITER (harmoniqs/amicode
opencode-plugin/traces.ts) and mirrored here — change both in one change-set (one-spine rule, same as run-terminal.ts).Why
This is the observability slot reserved when we hid the MCP popover: the data that answers "why was that turn slow" (it showed 3 model calls per greeting on the live check), "which turns silently errored" (the Gemini schema bug pattern), and "how do models compare" — locally, without chats leaving the machine. A future panel renders these; a future OTel exporter is a mapping, not a rewrite.
Verification
2 tests (index aggregation incl. malformed-line skip; bounded session read + id validation); typecheck clean; live-verified against a real session (index totals + per-span listing correct).
🤖 Generated with Claude Code