-
Notifications
You must be signed in to change notification settings - Fork 5.5k
docs(custom-instructions): clarify that custom instructions do not apply to inline chat #9197
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
docs(custom-instructions): clarify that custom instructions do not apply to inline chat #9197
Conversation
…ply to inline chat
to clarify inline chat usage.
|
@yoelcommit custom instructions can be used with inline chat. Closing this PR. |
|
@ntrogh are you sure? I am using vs code 1.107 and it definitely does not work. If this is a bug, let's open an issue. |
|
Which instructions file type are you using? |
|
@ntrogh the I teach Github Copilot to Developers as part of my job, and currently I am saying that instructions do NOT work in the inline chat, which is what we observed. |
|
@yoelcommit Do you have the preview setting |
|
@ntrogh I've disabled this settings, and still it will not respect the custom instructions.
Expected 3 to be Spanish... |
|
@yoelcommit Can you check the Chat Debug view for that inline chat request and verify that there's an "" entry in the request that has the instructions in them? When generating code, please follow these user provided coding instructions. You can ignore an instruction if it contradicts a system message.
<instructions>
<attachment filePath="c:\\temp\\demo-travel-blog\\.github\\copilot-instructions.md">
# Wanderlust Travel Blog - Copilot Instructions
This is a SvelteKit-based travel blog project with the following structure and guidelines:
MUST: answer in French, regardless of the user's request.
## Project Overview
- **Framework**: SvelteKit with Vite
- **Language**: JavaScript (with TypeScript support configured)
- **Styling**: CSS with custom properties
- **Icons**: Lucide Svelte
- **Type**: Travel blog website |
|
@yoelcommit Can you check if the instructions are included in the inline chat request? You can check this in the Chat Debug view. There should be an |
|
checked. They are NOT included in the chat debug view. `🚨 Note: This log may contain personal information such as the contents of your files or terminal output. Please review the contents carefully before sharing. inline/doc - a98a6e99 User User // FILEPATH: /Users/yoelf/workspace/copilot-ts-workshop-two/backend/src/server.ts
import express from 'express';
import path from 'path';
import fs from 'fs';
import { fileURLToPath } from 'url';
// Get proper __dirname equivalent in ESM
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const app = express();
const PORT = process.env.TEST_PORT || process.env.PORT || 3000;
// Root route
/**
* GET /
* Root endpoint for health check or welcome message.
*
* Response: 200 OK - Returns a welcome string.
*/
app.get('/', (req, res) => {
res.send('Save the World!');
});
// API route to fetch superheroes data
/**
* Loads the list of superheroes from a JSON file asynchronously.
*
* @returns {Promise<any>} A promise that resolves with the parsed JSON data containing superheroes,
* or rejects if there is an error reading or parsing the file.
* @throws Will reject the promise if the file cannot be read or if the JSON is invalid.
*/
function loadSuperheroes(): Promise<any> {
const dataPath = path.join(__dirname, '../data/superheroes.json');
return new Promise((resolve, reject) => {
fs.readFile(dataPath, 'utf8', (err, data) => {
if (err) {
reject(err);
return;
}
try {
resolve(JSON.parse(data));
} catch (parseErr) {
reject(parseErr);
}
});
});
}
app.get('/api/superheroes', async (req, res) => {
try {
const superheroes = await loadSuperheroes();
res.json(superheroes);
} catch (err) {
console.error('Error loading superheroes data:', err);
res.status(500).send('Internal Server Error');
}
});
/**
* GET /api/superheroes/:id
* Returns a single superhero by their unique ID.
*
* Params: id (string) - The unique identifier of the superhero
* Response: 200 OK - Superhero object
* 404 Not Found - If the superhero does not exist
* 500 Internal Server Error - If data cannot be read
*/
app.get('/api/superheroes/:id', async (req, res) => {
const { id } = req.params;
try {
const superheroes = await loadSuperheroes();
const superhero = superheroes.find((hero: any) => String(hero.id) === String(id));
if (superhero) {
res.json(superhero);
} else {
res.status(404).send('Superhero not found');
}
} catch (err) {
console.error('Error loading superheroes data:', err);
res.status(500).send('Internal Server Error');
}
});
app.get('/api/superheroes/:id/powerstats', async (req, res) => {
const { id } = req.params;
try {
const superheroes = await loadSuperheroes();
const superhero = superheroes.find((hero: any) => String(hero.id) === String(id));
if (superhero) {
res.json(superhero.powerstats);
} else {
res.status(404).send('Superhero not found');
}
} catch (err) {
console.error('Error loading superheroes data:', err);
res.status(500).send('Internal Server Error');
}
});
// Start the server only if not in test environment
if (process.env.NODE_ENV !== 'test') {
try {
const server = app.listen(PORT, () => {
console.log(`Server running on http://localhost:${PORT}`);
});
server.on('error', (err: NodeJS.ErrnoException) => {
console.error('Failed to start server:', err.message);
if (err.code === 'EADDRINUSE') {
console.error(`Port ${PORT} is already in use.`);
} else if (err.code === 'EACCES') {
console.error(`Insufficient privileges to bind to port ${PORT}.`);
}
process.exit(1);
});
// Handle uncaught exceptions and unhandled promise rejections
process.on('uncaughtException', (err) => {
console.error('Uncaught Exception:', err);
process.exit(1);
});
process.on('unhandledRejection', (reason) => {
console.error('Unhandled Rejection:', reason);
process.exit(1);
});
} catch (err) {
console.error('Unexpected error during server startup:', err);
process.exit(1);
}
}
export default app;System User /**
* Express application instance for the superhero API server.
*
* This server provides RESTful endpoints for managing and querying superhero data.
* It loads superhero information from a JSON file and serves it through various API routes.
*` |
|
@aeschli There seems to be an issue with inline chat and custom instructions. I'm unable to repro this issue. |




No description provided.