-
Notifications
You must be signed in to change notification settings - Fork 5k
Improved custom chat mode and Copilot instructions file #2681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
description: 'Fix and verify issues in app' | ||
model: GPT-5 (Preview) | ||
tools: ['extensions', 'codebase', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'fetch', 'findTestFiles', 'searchResults', 'githubRepo', 'runTests', 'runCommands', 'runTasks', 'editFiles', 'runNotebooks', 'search', 'new', 'get_issue', 'get_issue_comments', 'get-library-docs', 'playwright', 'pylance mcp server'] | ||
--- | ||
|
||
# Fixer Mode Instructions | ||
|
||
You are in fixer mode. When given an issue to fix, follow these steps: | ||
|
||
• **Gather context**: Read error messages/stack traces/related code. If the issue is a GitHub issue link, use 'get_issue' and 'get_issue_comments' tools to fetch the issue and comments. | ||
• **Make targeted fix**: Make minimal changes to fix the issue. Do not fix any issues that weren't identified. If any other issues pop up, note them as potential issues to be fixed later. | ||
• **Verify fix**: Test the application to ensure the fix works as intended and doesn't introduce new issues. For a backend change, add a new test in the tests folder and run the tests with VS Code "runTests" tool. RUN all the tests using that tool, not just the tests you added. Try to add tests to existing test files when possible, like test_app.py. DO NOT run the `pytest` command directly or create a task to run tests, ONLY use "runTests" tool. For a frontend change, use the Playwright server to manually verify or update e2e.py tests. | ||
|
||
## Local server setup | ||
|
||
You MUST check task output readiness before debugging, testing, or declaring work complete. | ||
|
||
- Start the app: Run the "Development" compound task (which runs both frontend and backend tasks) and check readiness from task output. Both must be in ready state: | ||
- Frontend task: "Frontend: npm run dev" | ||
- Backend task: "Backend: quart run" | ||
- Investigate and fix errors shown in the corresponding task terminal before proceeding. You may sometimes see an error with /auth_setup in frontend task, that's due to the backend server taking longer to startup, and can be ignored. | ||
- Both of the tasks provide hot reloading behavior: | ||
- Frontend: Vite provides HMR; changes in the frontend are picked up automatically without restarting the task. | ||
- Backend: Quart was started with --reload; Python changes trigger an automatic restart. | ||
- If watchers seem stuck or output stops updating, stop the tasks and run the "Development" task again. | ||
- To interact with a running application, use the Playwright MCP server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Adding new data | ||
|
||
New files should be added to the `data` folder, and then either run scripts/prepdocs.sh or script/prepdocs.ps1 to ingest the data. | ||
|
||
# Adding a new azd environment variable | ||
|
||
An azd environment variable is stored by the azd CLI for each environment. It is passed to the "azd up" command and can configure both provisioning options and application settings. | ||
When adding new azd environment variables, update: | ||
|
||
1. infra/main.parameters.json : Add the new parameter with a Bicep-friendly variable name and map to the new environment variable | ||
1. infra/main.bicep: Add the new Bicep parameter at the top, and add it to the `appEnvVariables` object | ||
1. azure.yaml: Add the new environment variable under pipeline config section | ||
1. .azdo/pipelines/azure-dev.yml: Add the new environment variable under `env` section | ||
1. .github/workflows/azure-dev.yml: Add the new environment variable under `env` section | ||
|
||
# Adding a new setting to "Developer Settings" in RAG app | ||
|
||
When adding a new developer setting, update: | ||
|
||
* frontend: | ||
* app/frontend/src/api/models.ts : Add to ChatAppRequestOverrides | ||
* app/frontend/src/components/Settings.tsx : Add a UI element for the setting | ||
* app/frontend/src/locales/*/translations.json: Add a translation for the setting label/tooltip for all languages | ||
* app/frontend/src/pages/chat/Chat.tsx: Add the setting to the component, pass it to Settings | ||
* app/frontend/src/pages/ask/Ask.tsx: Add the setting to the component, pass it to Settings | ||
|
||
* backend: | ||
* app/backend/approaches/chatreadretrieveread.py : Retrieve from overrides parameter | ||
* app/backend/approaches/retrievethenread.py : Retrieve from overrides parameter | ||
* app/backend/app.py: Some settings may need to sent down in the /config route. | ||
pamelafox marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
# When adding tests for a new feature: | ||
|
||
All tests are in the `tests` folder and use the pytest framework. | ||
There are three styles of tests: | ||
|
||
* e2e tests: These use playwright to run the app in a browser and test the UI end-to-end. They are in e2e.py and they mock the backend using the snapshots from the app tests. | ||
* app integration tests: Mostly in test_app.py, these test the app's API endpoints and use mocks for services like Azure OpenAI and Azure Search. | ||
* unit tests: The rest of the tests are unit tests that test individual functions and methods. They are in test_*.py files. | ||
|
||
When adding a new feature, add tests for it in the appropriate file. | ||
If the feature is a UI element, add an e2e test for it. | ||
If it is an API endpoint, add an app integration test for it. | ||
If it is a function or method, add a unit test for it. | ||
Use mocks from conftest.py to mock external services. | ||
|
||
When you're running tests, make sure you activate the .venv virtual environment first: | ||
|
||
```bash | ||
source .venv/bin/activate | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.