Skip to content

fix(background): pass full response to parse handler, not just body#2955

Open
ImmanuelHaffner wants to merge 1 commit intoolimorris:mainfrom
ImmanuelHaffner:fix/background-parse-chat
Open

fix(background): pass full response to parse handler, not just body#2955
ImmanuelHaffner wants to merge 1 commit intoolimorris:mainfrom
ImmanuelHaffner:fix/background-parse-chat

Conversation

@ImmanuelHaffner
Copy link
Copy Markdown

Description

Both ask_sync and ask_async were passing response.body (a raw JSON string) to the adapter's parse handler (e.g. chat_output). In non-streaming mode the handler expects the full response table {body, status, headers, …} and internally does data = data.body. Passing the pre-extracted string caused data.body to resolve to nil, silently breaking all background interactions (e.g. auto-title generation never produced a title).

Pass the full response table so the handler can extract .body itself, consistent with how the main chat HTTP path works.

AI Usage

Yes, Claude Opus 4.6 through CC ;)

Related Issue(s)

Screenshots

N/A

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I confirm that this PR has been majority created by me, and not AI (unless stated in the "AI Usage" section above)
  • I've run make all to ensure docs are generated, tests pass and StyLua has formatted the code
  • (optional) I've added test coverage for this fix/feature
  • (optional) I've updated the README and/or relevant docs pages

Both ask_sync and ask_async were passing `response.body` (a raw JSON
string) to the adapter's parse handler (e.g. `chat_output`).  In
non-streaming mode the handler expects the full response table
`{body, status, headers, …}` and internally does `data = data.body`.
Passing the pre-extracted string caused `data.body` to resolve to nil,
silently breaking all background interactions (e.g. auto-title
generation never produced a title).

Pass the full `response` table so the handler can extract `.body`
itself, consistent with how the main chat HTTP path works.
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