Skip to content

fix(api): give the error-samples payload mock its cutAttributeBytes - #1171

Merged
JeremyFunk merged 1 commit into
mainfrom
fix/ai-sessions-error-samples-test
Sep 30, 2026
Merged

JeremyFunk merged 1 commit into
mainfrom
fix/ai-sessions-error-samples-test

Conversation

@JeremyFunk

@JeremyFunk JeremyFunk commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes red CI on main (ai-sessions.http.test.ts > error-samples > reads the payloads for the page: 500 ≠ 200), which also blocked Deploy PRD.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

#1148's second commit added cutAttributeBytes to the payload row schema; the http test's mock row lacked it, so decode failed and the route returned 500.
@maple-review-bot

maple-review-bot Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 5/5 · safe to merge
Test-only fixture fix; the schema requirement and the fallback byte counts both check out against the assertions in the same test.
quality 100/100 · no findings · tests covered · risk low

Adds the missing cutAttributeBytes field to the error-samples payload mock in ai-sessions.http.test.ts, restoring the row decode that the new schema requires. One-line test-fixture fix, safe to merge.

  • ai-sessions.http.test.ts payload mock row now carries cutAttributeBytes: {}
What was checked
  • aiToolErrorPayloadsRowSchema requires cutAttributeBytes (query-engine-integrations/src/ai/ai-tools.ts:964), so the mock previously failed decode
  • With {}, aiToolErrorPayload falls back to utf8.encode(text).length, which matches the asserted argumentsBytes: 2 and resultBytes at test lines 1710-1712
  • Other tests in the file decode no payload rows (only occurrences rows or []), so no second mock is missing the field

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

@JeremyFunk
JeremyFunk merged commit ad9a063 into main Sep 30, 2026
33 of 35 checks passed
@JeremyFunk
JeremyFunk deleted the fix/ai-sessions-error-samples-test branch September 30, 2026 10:07
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 687a4b3f-e1f0-4d7e-8444-1b33ba510f55

📥 Commits

Reviewing files that changed from the base of the PR and between 671e80a and 6eecaf0.

📒 Files selected for processing (1)
  • apps/api/src/routes/internal/ai-sessions.http.test.ts
 _____________________________________________________________________
< No matter how far down the wrong road you have gone, turn back now. >
 ---------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

JeremyFunk added a commit that referenced this pull request Sep 30, 2026
…teBytes (#1172)

Same gap as #1171 in apps/ai: #1148 made cutAttributeBytes a required column of the payload row; the fixture lacked it, so every get_agent_tool_error test failed row decode.
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