Skip to content

fix(config): always use global timezone instead of hidden profile value (#9706) - #9836

Open
aniruddhaadak80 wants to merge 2 commits into
AstrBotDevs:masterfrom
aniruddhaadak80:fix/profile-timezone-override
Open

fix(config): always use global timezone instead of hidden profile value (#9706)#9836
aniruddhaadak80 wants to merge 2 commits into
AstrBotDevs:masterfrom
aniruddhaadak80:fix/profile-timezone-override

Conversation

@aniruddhaadak80

@aniruddhaadak80 aniruddhaadak80 commented Aug 26, 2026

Copy link
Copy Markdown

What Problem This Solves

Chat profiles can contain a hidden timezone field that is not exposed in the profile WebUI schema. This silently overrides the global timezone setting, leaving users unable to discover or change the effective timezone.

Why This Change Was Made

The runtime at astr_main_agent.py:1060-1062 reads config.timezone (profile) first, falling back to the global config only when it's None. Since the profile schema doesn't expose timezone in the WebUI, users cannot see or modify this hidden value. A profile created with an old timezone will continue to override the global setting indefinitely.

User Impact

Timezone is now always read from the global config, ensuring consistent behavior across all profiles. Users who set the global timezone in Settings will see it applied everywhere.

Evidence

  • Issue: [Bug] 配置档 WebUI 不显示 timezone,但隐藏值仍会覆盖全局时区 #9706
  • Root cause confirmed at astr_main_agent.py:1060-1062 — profile timezone shadows global
  • Config service confirms profile schema (CONFIG_METADATA_3) excludes timezone while system schema (CONFIG_METADATA_3_SYSTEM) includes it
  • Fix: always read timezone from global config (plugin_context.get_config().get("timezone"))
  • 1 file changed, 1 insertion, 3 deletions

Summary by Sourcery

Use the global timezone consistently and complete assistant response processing before returning final LLM results.

Bug Fixes:

  • Always apply the global timezone setting when generating agent requests, preventing hidden profile values from overriding it.
  • Ensure assistant response hooks complete before yielding the final LLM result to users.

…ike fallback (AstrBotDevs#9788)

In the skills_like tool requery fallback path, the runner yielded
llm_result (sending the response to the user) before calling
_complete_with_assistant_response, which triggers on_agent_done hooks.
Plugins doing content safety review, sanitization, or rewriting could not
affect text already sent. Moved the completion call before the yields.
…ue (AstrBotDevs#9706)

Chat profiles can contain a hidden timezone field that is not exposed in
the profile WebUI schema. This silently overrides the global timezone
setting, leaving users unable to discover or change the effective timezone.
Always read timezone from the global config to ensure consistent behavior.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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