Repository navigation
Conversation
Replace experimental.log_messages boolean with a string union
('info' | 'debug' | 'trace') that controls verbosity:
- 'info': messages + response text (logInfo)
- 'debug': adds generation params (logDebug)
- 'trace': adds raw provider-native request body (logDebug)
The experimental.log_messages config was only wired into the native LLM runtime path. The default AI SDK runtime had no logging support, so the setting appeared broken for most users. - Log request (model, messages, generation params) before streamText - Log response events via Stream.tap in the LLMEvent pipeline - Reuse MessageLogger.formatEvents for response formatting
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #29186
Type of change
What does this PR do?
Adds configurable LLM request/response logging via
experimental.log_messages("info","debug","trace") and wires it into both the native and AI SDK runtimes."info"— logs messages + response text (Effect.logInfo)"debug"— adds generation params (Effect.logDebug)"trace"— adds raw provider-native request body (native runtime only, Effect.logDebug)Also fixes a crash on
--continuewhere a"dummy"session ID placeholder triggered a server-side validation error — the fake route was removed and the App component's existing--continueeffecthandles navigation once sync loads.
How did you verify your code works?
OPENCODE_LOG_LEVEL=DEBUG—LLM requestandLLM responseentries appear in the log file at all three verbosity levels--continueno longer shows the"ses"validation errorChecklist
If you do not follow this template your PR will be automatically rejected.