Skip to content

Override ozon-analyzer prompts with user-defined custom prompts from localStorage#23

Merged
LebedevIV merged 4 commits intofuture/optimizationfrom
investigate/ozon-analyzer-custom-prompt-override
Nov 18, 2025
Merged

Override ozon-analyzer prompts with user-defined custom prompts from localStorage#23
LebedevIV merged 4 commits intofuture/optimizationfrom
investigate/ozon-analyzer-custom-prompt-override

Conversation

@cto-new
Copy link

@cto-new cto-new bot commented Nov 16, 2025

Summary

  • Enable user-defined prompts override for Ozon Analyzer by reading plugin-ozon-analyzer-settings from chrome.storage.local and applying them to manifest-based prompts.

Details

  • Load custom prompts for basic_analysis and deep_analysis from local storage for both ru and en, and override non-empty custom_prompt values.
  • Ensure top-level data structures for Pyodide (basic_analysis and deep_analysis) are populated with the resulting prompts to preserve expected runtime behavior.
  • Preserve backward compatibility: manifest defaults are used when custom prompts are missing or empty.
  • Introduce extensive LLM_PROMPT_DEBUG logging to trace prompt loading, overriding, and final prompt formation, including summaries of overrides and data snapshots before sending to the LLM engine.
  • Add instrumentation for safe fallback and error handling to avoid breaking prompt delivery when storage access fails.

Impact

  • No breaking changes; user prompts augment the flow when provided while maintaining manifest defaults as a fallback.

Testing

  • Validate with cases where custom_prompt exists (ru/en), is empty, or is missing; verify AI receives the expected prompts.
  • Confirm that the enhanced logs provide clear traces of the prompt override process.

Documentation

  • Aligns with updates to FIX_IMPLEMENTATION.md, INVESTIGATION_REPORT.md, SOLUTION_SUMMARY.md, and CUSTOM_PROMPT_FIX_README.md.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. We will check and reply to you as soon as possible.

@cto-new cto-new bot marked this pull request as ready for review November 16, 2025 19:06
@LebedevIV LebedevIV merged commit ce8faf1 into future/optimization Nov 18, 2025
3 of 28 checks passed
@LebedevIV LebedevIV deleted the investigate/ozon-analyzer-custom-prompt-override branch November 22, 2025 00:28
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