Skip to content

debug-cli successfully receives references but prod does not work #14

Open
@shyim

Description

Hey,

in cli I get

Image

but the web always errors without anything

Image

I am also totally lost as the docs are not very clear how to attach to a message references.

My code is:

w.writeEvent("copilot_references")
w.writeData(copilotReferences)
w.writeDone()

w.writeData(sseResponse{
	Choices: choices,
})

w.writeDone()

My SSE looks like this:

event: copilot_references
data: [{"type":"document","id":"data/docs/guides/hosting/performance/caches.md_0","metadata":{"display_name":"guides/hosting/performance/caches.md","display_icon":"icon","display_url":"https://github.com/shopware/docs/blob/main/guides/hosting/performance/caches.md"}},{"type":"document","id":"data/docs/guides/hosting/performance/performance-tweaks.md_0","metadata":{"display_name":"guides/hosting/performance/performance-tweaks.md","display_icon":"icon","display_url":"https://github.com/shopware/docs/blob/main/guides/hosting/performance/performance-tweaks.md"}},{"type":"document","id":"data/src/Administration/Resources/app/administration/src/module/sw-settings-cache/component/sw-settings-cache-modal/sw-settings-cache-modal.twig_0","metadata":{"display_name":"src/Administration/Resources/app/administration/src/module/sw-settings-cache/component/sw-settings-cache-modal/sw-settings-cache-modal.twig","display_icon":"icon","display_url":"https://github.com/shopware/shopware/blob/trunk/src/Administration/Resources/app/administration/src/module/sw-settings-cache/component/sw-settings-cache-modal/sw-settings-cache-modal.twig"}},{"type":"document","id":"data/docs/guides/hosting/performance/index.md_0","metadata":{"display_name":"guides/hosting/performance/index.md","display_icon":"icon","display_url":"https://github.com/shopware/docs/blob/main/guides/hosting/performance/index.md"}},{"type":"document","id":"data/docs/products/extensions/migration-assistant/guides.md_0","metadata":{"display_name":"products/extensions/migration-assistant/guides.md","display_icon":"icon","display_url":"https://github.com/shopware/docs/blob/main/products/extensions/migration-assistant/guides.md"}}]
data: [DONE]

data: {"choices":[{"index":0,"delta":{"role":"assistant","content":"Clearing the cache in Shopware 6 can be done using the command line, Admin interface, or via code execution. Below are the steps for each method:\n\n### Via Command Line\n\n1. **Open your terminal or SSH into your server**.\n2. **Navigate to your Shopware installation directory**.\n3. **Run the cache clear command**:\n\n```sh\nbin/console cache:clear\n```\n\nThis will clear all caches in the Shopware system.\n\n### Via Admin Interface\n\n1. **Log in to Shopware Admin**.\n2. **Go to the \"Settings\" section**.\n3. **Navigate to \"System\" \u003e \"Caches \u0026 Indexes\"**.\n4. **Click the \"Clear Cache\" button**.\n\nA modal will appear to confirm the action, and you can proceed by clicking the appropriate button to clear the cache.\n\n### Programmatically via Code\n\nIf you want to clear the cache programmatically, you can use the `cache.warmer` service.\n\nHere's an example:\n\n```php\n\u003c?php\nnamespace App\\Controller;\n\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Contracts\\Service\\Attribute\\Required;\n\nclass CacheController extends AbstractController\n{\n    private $cacheWarmer;\n\n    /**\n     * @Required\n     */\n    public function setCacheWarmer($cacheWarmer)\n    {\n        $this-\u003ecacheWarmer = $cacheWarmer;\n    }\n\n    public function clearCache(): Response\n    {\n        $this-\u003ecacheWarmer-\u003eclear();\n\n        return new Response('Cache cleared');\n    }\n}\n```\n\n### Specific Cache Types\n\nYou might want to clear specific types of cache (e.g. HTTP cache, template cache, etc.). Here’s how to clear them:\n\n#### HTTP Cache\n\n```sh\nbin/console http:cache:clear\n```\n\n#### Template Cache\n\n```sh\nbin/console theme:compile\n```\n\n### Summary\n\n- Use `bin/console cache:clear` to clear the entire cache via terminal.\n- Use the Admin interface in the \"Settings\" section to clear the cache.\n- Clear cache programmatically by leveraging the `cache.warmer` service.\n- Use specific commands for clearing specific caches like HTTP or template cache.\n\nEach method caters to different needs, and you can choose the one that best fits your scenario. If you face any issues clearing the cache, ensure that the file permissions are correctly set for the cache directories."}}]}
data: [DONE]

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions