Skip to content

fix: use shared app chat context#8700

Draft
centdix wants to merge 3 commits intomainfrom
consolidate-app-context
Draft

fix: use shared app chat context#8700
centdix wants to merge 3 commits intomainfrom
consolidate-app-context

Conversation

@centdix
Copy link
Copy Markdown
Collaborator

@centdix centdix commented Apr 3, 2026

Summary

Move raw app chat selection onto the shared copilot context pipeline so app mode uses the same selected-context mechanism as flow mode instead of a separate current-file/current-runnable path.

Changes

  • route raw app file and runnable selection through ContextManager and keep app available context in sync there
  • remove the dedicated app footer chip/exclude logic for the current file or runnable and rely on normal selected context badges instead
  • make app prompt construction read active file or runnable context from shared selected context only, and keep inspector/code-selection context separate
  • update the app eval runner to pass the shared context list explicitly after removing the fallback path

Test plan

  • Run npm run check:fast
  • Inspect frontend dev logs after the raw app editor rebuild to confirm the Svelte infinite update loop is gone
  • Inspect backend logs to confirm the backend stayed healthy
  • Run full npm run check once the existing missing wasm parser packages are available in this environment

Notes

  • npm run check still fails on pre-existing missing modules windmill-parser-wasm-r and windmill-parser-wasm-wac from frontend/src/lib/infer.ts
  • local frontend/package-lock.json remains dirty but is unrelated and not included in this branch changes

Generated with Claude Code


Summary by cubic

Routes app chat selection through the shared ContextManager with an active-selection flag, and separates transient editor state from persisted selection. Unifies context selection, badges, and prompt building, and fixes the raw app editor update loop.

  • Refactors

    • Introduce AppSelection (persisted in ContextManager via activeSelection) and AppTransientContext (inspector/code selection only).
    • Add aiChatManager.syncAppSelection(...), updateAvailableContextForApp(...), and setSelectedAppContext(...) to keep app available/selected context in sync.
    • Always read availableContext from ContextManager; show selected file/runnable via standard badges (removed app-specific chips and exclusion toggle).
    • Build app prompts from shared selected context plus transient inspector/code selection; add format/truncation helpers; update tools to read selection from ContextManager.
    • Raw app editor now exposes getTransientContext() and pushes selection via syncAppSelection; removed exclusion and runnable-clear path.
    • Include app context in persisted message contextElements for APP mode as well.
  • Bug Fixes

    • Eliminates the Svelte infinite update loop in the raw app editor by removing app-specific context paths.

Written for commit f31c68e. Summary will update on new commits.

centdix and others added 2 commits April 3, 2026 17:44
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 3, 2026

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: f31c68e
Status: ✅  Deploy successful!
Preview URL: https://88184a58.windmill.pages.dev
Branch Preview URL: https://consolidate-app-context.windmill.pages.dev

View logs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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