Skip to content

fix: wasm location in Dockerfiles#129

Merged
spypsy merged 1 commit into
masterfrom
sp/dockerfile-circuits-wasm
Mar 30, 2023
Merged

fix: wasm location in Dockerfiles#129
spypsy merged 1 commit into
masterfrom
sp/dockerfile-circuits-wasm

Conversation

@spypsy
Copy link
Copy Markdown
Member

@spypsy spypsy commented Mar 30, 2023

Description

Please provide a paragraph or two giving a summary of the change, including relevant motivation and context.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@spypsy spypsy merged commit fec5d4a into master Mar 30, 2023
@spypsy spypsy deleted the sp/dockerfile-circuits-wasm branch March 30, 2023 11:28
AztecBot added a commit that referenced this pull request May 14, 2026
## Summary

Two small changes to the `AztecDocsWidget` (the in-docs "Ask Aztec" panel that talks to honk-ai):

### 1. User feedback (thumbs up / down on assistant replies)

After an assistant message finishes streaming, render thumbs-up / thumbs-down buttons. Clicking one POSTs to `${apiHost}/api/feedback` with `{ conversation_id, question_index, feedback: "like" | "dislike", api_key }` (matching honk-ai's existing `SubmitFeedback` route in `application/api/answer/routes/feedback.py`). The choice is locked client-side (`feedbackByIndex` per-message-index) so a user can vote once; both buttons become disabled after the first vote, with the active choice highlighted.

Files:
- `docs/src/components/AztecDocsWidget/Icons.jsx` — `thumbUp`/`thumbDown` SVGs.
- `docs/src/components/AztecDocsWidget/Message.jsx` — feedback row, only for assistant messages with a non-empty `response`, hidden while streaming.
- `docs/src/components/AztecDocsWidget/Panel.jsx` — passes the `onFeedback` callback down.
- `docs/src/components/AztecDocsWidget/index.jsx` — `handleFeedback`, marks the message as voted optimistically and short-circuits repeat clicks. On POST failure, the optimistic mark is reverted and an inline "Couldn't save feedback." note is shown so the user can retry.
- `docs/src/components/AztecDocsWidget/sendFeedback.js` — small fetch helper that throws on non-2xx so the caller can surface the failure.

### 2. Surface backend errors to the user

honk-ai PR #129 changed `complete_stream` to emit a `type: "error"` SSE frame with the sanitized real cause (timeout / 429 / 503 / …) instead of the generic "Please try again later". The docs widget previously consumed only `answer` / `source` / `id` / `end` frames and silently dropped `error` frames. This PR adds an `onError` path:

- `streamAnswer.js` — branch on `type === "error"` and invoke a new `onError(message)` callback, reading `parsed.error` to match honk-ai's frame shape (`{"type": "error", "error": "..."}`).
- `index.jsx` — store the error on the active assistant message as `error: <text>`, stop the streaming spinner.
- `Message.jsx` — when `message.error` is set, render the body inside a vermillion `[error]` alert box so the user actually sees what went wrong (rate limit, upstream timeout, etc.) instead of a stalled empty bubble.

Together with honk-ai #129 this means: backend failures now reach the docs widget user with a real, actionable cause; and we start collecting per-message feedback signal from the docs surface.

## Related

- honk-ai #129 (server-side error relay + per-message logging) — required for the error path to deliver useful messages.
- Thread context: docs-widget gap identified in the activity report (https://gist.github.com/AztecBot/4932e495f8d622cc3c82c1776e37f891).

## Test plan

- [ ] `yarn workspace docs start` and exercise the widget: trigger a normal answer, click thumbs up/down, verify a POST to `/api/feedback` with the expected payload and that both buttons lock after one click.
- [ ] Click the opposite thumb after voting; verify nothing happens (no second POST, state unchanged).
- [ ] Simulate a backend error frame (e.g. point widget at a stub that emits `{"type":"error","error":"upstream timeout"}`); verify the vermillion alert renders with the real text and the spinner stops.
- [ ] Simulate a feedback POST failure (e.g. 500); verify the "Couldn't save feedback." note renders and the user can re-vote.

---
*Created by [claudebox](https://claudebox.work/v2/sessions/0334e56dbe6330cd) · group: `slackbot`*

Co-authored-by: critesjosh <Josh@aztec-labs.com>
AztecBot added a commit that referenced this pull request May 14, 2026
## Summary

Two small changes to the `AztecDocsWidget` (the in-docs "Ask Aztec" panel that talks to honk-ai):

### 1. User feedback (thumbs up / down on assistant replies)

After an assistant message finishes streaming, render thumbs-up / thumbs-down buttons. Clicking one POSTs to `${apiHost}/api/feedback` with `{ conversation_id, question_index, feedback: "like" | "dislike", api_key }` (matching honk-ai's existing `SubmitFeedback` route in `application/api/answer/routes/feedback.py`). The choice is locked client-side (`feedbackByIndex` per-message-index) so a user can vote once; both buttons become disabled after the first vote, with the active choice highlighted.

Files:
- `docs/src/components/AztecDocsWidget/Icons.jsx` — `thumbUp`/`thumbDown` SVGs.
- `docs/src/components/AztecDocsWidget/Message.jsx` — feedback row, only for assistant messages with a non-empty `response`, hidden while streaming.
- `docs/src/components/AztecDocsWidget/Panel.jsx` — passes the `onFeedback` callback down.
- `docs/src/components/AztecDocsWidget/index.jsx` — `handleFeedback`, marks the message as voted optimistically and short-circuits repeat clicks. On POST failure, the optimistic mark is reverted and an inline "Couldn't save feedback." note is shown so the user can retry.
- `docs/src/components/AztecDocsWidget/sendFeedback.js` — small fetch helper that throws on non-2xx so the caller can surface the failure.

### 2. Surface backend errors to the user

honk-ai PR #129 changed `complete_stream` to emit a `type: "error"` SSE frame with the sanitized real cause (timeout / 429 / 503 / …) instead of the generic "Please try again later". The docs widget previously consumed only `answer` / `source` / `id` / `end` frames and silently dropped `error` frames. This PR adds an `onError` path:

- `streamAnswer.js` — branch on `type === "error"` and invoke a new `onError(message)` callback, reading `parsed.error` to match honk-ai's frame shape (`{"type": "error", "error": "..."}`).
- `index.jsx` — store the error on the active assistant message as `error: <text>`, stop the streaming spinner.
- `Message.jsx` — when `message.error` is set, render the body inside a vermillion `[error]` alert box so the user actually sees what went wrong (rate limit, upstream timeout, etc.) instead of a stalled empty bubble.

Together with honk-ai #129 this means: backend failures now reach the docs widget user with a real, actionable cause; and we start collecting per-message feedback signal from the docs surface.

## Related

- honk-ai #129 (server-side error relay + per-message logging) — required for the error path to deliver useful messages.
- Thread context: docs-widget gap identified in the activity report (https://gist.github.com/AztecBot/4932e495f8d622cc3c82c1776e37f891).

## Test plan

- [ ] `yarn workspace docs start` and exercise the widget: trigger a normal answer, click thumbs up/down, verify a POST to `/api/feedback` with the expected payload and that both buttons lock after one click.
- [ ] Click the opposite thumb after voting; verify nothing happens (no second POST, state unchanged).
- [ ] Simulate a backend error frame (e.g. point widget at a stub that emits `{"type":"error","error":"upstream timeout"}`); verify the vermillion alert renders with the real text and the spinner stops.
- [ ] Simulate a feedback POST failure (e.g. 500); verify the "Couldn't save feedback." note renders and the user can re-vote.

---
*Created by [claudebox](https://claudebox.work/v2/sessions/0334e56dbe6330cd) · group: `slackbot`*
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