aws / aws/amazon-q-developer-cli

Feature Request: Support system-level instructions for agent prompts

Aperta
#3,314 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Summary

The agent `prompt` field is currently injected as a context entry rather than system-level instructions, limiting its authority and effectiveness.

## Current Behavior

Agent prompts are added to the conversation as context entries in `conversation.rs:841-842`:

```rust
if let Some(agent_prompt) = self.agents.get_active().and_then(|a| a.prompt.as_ref()) {
context_content.push_str(&format!("Follow this instruction: {}", agent_prompt));
}
```

This makes them easily overridable and treated as optional guidance rather than mandatory behavioral requirements.

## Expected Behavior

The agent `prompt` field should function as system-level instructions with higher authority than context entries. According to the [agent format documentation](https://github.com/aws/amazon-q-developer-cli/blob/main/docs/agent-format.md#prompt-field), it should be "similar to a system prompt."

## Root Cause

The underlying Q Developer API only supports `UserInputMessage` and `AssistantResponseMessage` types with no system prompt field in `ConversationState` (see `crates/amzn-codewhisperer-streaming-client/src/types/_conversation_state.rs`).

In contrast, AWS Bedrock Agents have proper system prompt support via the `instruction` field.

## Suggested Solution

Enhance the Q Developer API to support system-level instructions similar to Bedrock's approach, or improve the current implementation to give agent prompts higher priority and authority.

---

*Note: This implementation has been unchanged since commit `a48bfad0` (July 22, 2025).*

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dalla gestione dei prompt dell’agente in conversation.rs:841-842 e dai tipi di messaggio in crates/amzn-codewhisperer-streaming-client/src/types/_conversation_state.rs. Determina se l’API può rappresentare istruzioni a livello di sistema o se il comportamento esistente deve cambiare. Il lavoro è completato quando i prompt dell’agente hanno l’autorità documentata simile a quella di un system prompt, con test o documentazione che mostrino il comportamento risultante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
backend-api-design, cli
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.