diff options
Diffstat (limited to 'agent/orchestrator/models')
| -rw-r--r-- | agent/orchestrator/models/base.py | 1 | ||||
| -rw-r--r-- | agent/orchestrator/models/claude_code.py | 10 |
2 files changed, 3 insertions, 8 deletions
diff --git a/agent/orchestrator/models/base.py b/agent/orchestrator/models/base.py index 4ca1988..cdcbb5c 100644 --- a/agent/orchestrator/models/base.py +++ b/agent/orchestrator/models/base.py @@ -21,6 +21,7 @@ Role = Literal["system", "user", "assistant", "tool"] class Message: role: Role content: str + name: str | None = None @dataclass diff --git a/agent/orchestrator/models/claude_code.py b/agent/orchestrator/models/claude_code.py index c73df98..293de3e 100644 --- a/agent/orchestrator/models/claude_code.py +++ b/agent/orchestrator/models/claude_code.py @@ -52,17 +52,11 @@ class ClaudeCodeBackend(ModelBackend): return ModelResponse(content=result.stdout.strip()) def _format_prompt(self, request: ModelRequest) -> str: - """Flatten messages + dynamic context into a single prompt string. - - Claude Code's -p mode takes one big prompt, not a structured - conversation. We render the conversation as a readable transcript with - the per-turn context prepended. Persona is NOT here; Claude Code - finds it in the workspace itself. - """ parts = [] if request.turn_context: parts.append(f"## Context for this turn\n\n{request.turn_context}\n") for msg in request.messages: - parts.append(f"## {_ROLE_LABELS[msg.role]}\n\n{msg.content}\n") + label = msg.name or _ROLE_LABELS[msg.role] + parts.append(f"## {label}\n\n{msg.content}\n") parts.append("## Assistant\n\n") return "\n".join(parts) |
