Skip to content

fix: md/raw switch alignment, and effect 4.0.4 span changes breaking CI - #1450

Merged
Makisuo merged 2 commits into
mainfrom
fix/view-switch-alignment
Oct 14, 2026
Merged

Makisuo merged 2 commits into
mainfrom
fix/view-switch-alignment

Conversation

@Makisuo

@Makisuo Makisuo commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

What

1. MD/RAW switch alignment. The switch on the agent session System prompt card (and the span expansion's system message panel) now sits at the top of the body, next to the copy button. ViewSwitch defaults to self-center, which is right in one-line header rows but put it halfway down a tall items-start body.

2. effect 4.0.4 span changes (main CI has been red since #1449). Effect 4.0.2+ changed two things about HTTP spans:

  • Server and client spans are named by method alone (GET, not http.server GET / http.client GET).
  • A 5xx server span is now failed by effect itself with HttpServerError(ResponseError).

The second one changes production behavior. The SDK tracer only added its HttpServerErrorResponse exception marker when the span's exit succeeded, so after the bump, 5xx responses rendered by the Worker bridge would show up in error tracking as a generic HttpServerError instead of the marker that UNEXPECTED_IDENTITY_MARKERS handles. flushable-tracer.ts now treats effect's response failure the same as a 5xx rendered on a successful exit. It checks the failure's shape rather than importing effect's error class, so the SDK still works with any effect in its ^4.0.0 peer range. A changeset bumps @maple-dev/effect-sdk (patch).

The span name change needs no production fix: normalizedSpanNameExpr and the rollup SQL already handle bare GET/POST names.

Tests that found spans by name now match on span kind instead (plus http.request.method for client spans, since the warehouse's database span is a client span too). This also fixes the warehouse "no http.client span" check, which would otherwise have passed vacuously after the rename.

Verified locally

  • electric-sync worker-bridge, api worker-bridge, ai worker/http, backend WarehouseQueryService, infra isolate-age, effect-sdk flushable-tracer all pass.
  • The new SDK test fails without the tracer change.
  • tsc is clean in the five packages touched.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • HTTP 5xx server failures are now represented in tracing with the rendered HTTP status message and a single response-error event, instead of being grouped as generic failures.
  • Style
    • Aligned view-switch controls to the top of system prompts and expanded system messages.

ViewSwitch defaults to self-center, which is right in one-line header rows
but floats it halfway down a tall items-start body, away from the copy
button beside it.
@maple-review-bot

maple-review-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge
quality 100/100 · no findings · tests not needed · risk low

Passes className="self-start" to the two body-level ViewSwitch call sites so the md/raw toggle aligns with the top of the clamped prompt body. Class-only change that matches the existing error-payload call site; safe to merge.

  • SystemBlock and span-expansion's SystemMessageRow pass self-start to ViewSwitch
What was checked
  • className is tailwind-merged last in ViewSwitch (payload-view.tsx:70 via @maple/ui/lib/utils), so self-start overrides the default self-center
  • Both call sites sit in flex items-start rows (session-transcript.tsx:638, span-expansion.tsx:311), so top alignment is the intended result
  • className was already a ViewSwitch prop, used the same way at span-expansion.tsx:571

25db42f · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 475c4bf4-d91b-4be7-9ff3-0ab0dd0aae98
📥 Commits

Reviewing files that changed from the base of the PR and between 25db42f and 4d3b5b2.

📒 Files selected for processing: 7
  • .changeset/sdk-effect-5xx-response-failure.md
  • apps/ai/src/worker/http.test.ts
  • apps/api/src/worker-bridge.test.ts
  • apps/electric-sync/src/worker-bridge.test.ts
  • packages/backend/src/services/warehouse/WarehouseQueryService.test.ts
  • packages/effect-sdk/src/shared/flushable-tracer.test.ts
  • packages/effect-sdk/src/shared/flushable-tracer.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough

HTTP 5xx response failures now use the rendered server-error span path. Span tests identify server spans by OTLP kind and client spans by request-method attributes. System-prompt and expanded system-message view switches now use self-start alignment.

Changes: HTTP span handling and tests

Layer / File(s) Summary
Handle HTTP 5xx response failures
packages/effect-sdk/src/shared/flushable-tracer.ts, packages/effect-sdk/src/shared/flushable-tracer.test.ts, .changeset/sdk-effect-5xx-response-failure.md
The tracer recognizes a failure containing one HTTP server ResponseError and applies the rendered server 5xx status and event handling. A test checks the span message and exception event. The changeset describes the behavior.
Identify spans by kind and attributes
apps/ai/src/worker/http.test.ts, apps/api/src/worker-bridge.test.ts, apps/electric-sync/src/worker-bridge.test.ts, packages/backend/src/services/warehouse/WarehouseQueryService.test.ts
Worker bridge tests select server spans by OTLP kind. Warehouse tracing tests identify HTTP client spans by request-method attributes.

System-message view switch alignment

Layer / File(s) Summary
Apply start alignment
apps/web/src/components/agent-sessions/session-detail/session-transcript.tsx, apps/web/src/components/agent-sessions/session-detail/span-expansion.tsx
Both ViewSwitch controls now use self-start styling. The expanded system-message control retains its existing rendered/raw props and callback.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4d3b5

No actionable merge-blocking issue is established; the changed behavior can proceed through normal checks.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 8 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately identifies the MD/RAW switch alignment and the Effect span changes that address CI failures. It is specific and related to the changeset.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

effect 4.0.2+ names HTTP spans by method alone ("GET", not "http.server GET")
and fails a 5xx server span itself with HttpServerError(ResponseError). The
SDK only stamped its HttpServerErrorResponse marker on a successful exit, so
rendered 5xx responses would land in error tracking as a generic
HttpServerError. It now treats effect's response failure the same way.

Tests that found server and client spans by name now match on span kind
(and http.request.method for client spans, since database spans are clients
too), which also keeps the warehouse "no http.client span" check from
passing vacuously.
@Makisuo Makisuo changed the title fix(web): pin the md/raw switch to the top of system prompt bodies fix: md/raw switch alignment, and effect 4.0.4 span changes breaking CI Oct 14, 2026
@maple-review-bot

maple-review-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
The 5xx rule is narrow and pinned, but the Effect 4.0.2 HttpServerError/ResponseError shape is only mirrored by a hand-built fixture, never a real router round trip.
quality 100/100 · no findings · tests covered · risk medium

Two unrelated threads: ViewSwitch is pinned to the top of the system-prompt bodies (self-start), and the SDK tracer now treats Effect's own HttpServerError/ResponseError for a 5xx as the rendered 5xx. Both are contained; the tracer branch is narrowly gated and tested.

  • ViewSwitch takes self-start at the two body-level call sites
  • makeOtlpSpan accepts an HttpServerError/ResponseError failure for a 5xx as renderedServerError
  • Worker-bridge and warehouse span tests now select server spans by kind
  • New test pins HttpServerErrorResponse on a failed 5xx span
What was checked
  • New branch only fires on a single Fail reason tagged HttpServerError/ResponseError, so Die causes keep their own exception name (flushable-tracer.ts:263)
  • renderedServerError still requires kind server and status ≥ 500, so client spans and 4xx keep their old status (flushable-tracer.ts:254)
  • Anticipated identifiers are all 4xx (apps/ai/src/mcp/expected-failures.ts:19), so the new branch cannot override an anticipated-Ok span

4d3b5b2 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit ed8a412 into main Oct 14, 2026
40 checks passed
@Makisuo
Makisuo deleted the fix/view-switch-alignment branch October 14, 2026 10:51
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