Skip to content

[Python] Set default value for ephemeral parameter in log_message method to False#812

Closed
brettcannon wants to merge 3 commits intogithub:mainfrom
brettcannon:client.session.log
Closed

[Python] Set default value for ephemeral parameter in log_message method to False#812
brettcannon wants to merge 3 commits intogithub:mainfrom
brettcannon:client.session.log

Conversation

@brettcannon
Copy link
Contributor

Also narrow the parameter's type along the way.

@brettcannon brettcannon requested a review from a team as a code owner March 12, 2026 21:54
Copilot AI review requested due to automatic review settings March 12, 2026 21:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Python SDK’s CopilotSession.log() API to make ephemeral default to False (and narrows its type), while also adjusting the method’s docstring.

Changes:

  • Set CopilotSession.log(..., ephemeral=...) default from None to False and narrow the parameter type to bool.
  • Update log() docstring text describing defaults for level and ephemeral.

@SteveSandersonMS
Copy link
Contributor

SteveSandersonMS commented Mar 13, 2026

@brettcannon This changes the semantics a bit. Previously we could differentiate "false" and "not set", but we'd lose that distinction with this change.

I think we'd be better off documenting the behavior as "If the flag is not set, the underlying runtime applies its own rules to control whether the log message is ephemeral".

For example we might want info-level messages to be ephemeral and errors not to be ephemeral, or to use other runtime conditions to decide.

All the other languages are consistent with this too, except for Go which actually fails to send "false" values at all from this API. I'm fixing Go separately in #827

@brettcannon
Copy link
Contributor Author

I think we'd be better off documenting the behavior as "If the flag is not set, the underlying runtime applies its own rules to control whether the log message is ephemeral".

SGTM! I'll close this PR.

@brettcannon brettcannon deleted the client.session.log branch March 13, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants