| 1 | package agent |
| 2 | |
| 3 | // agentConfig is everything New fixes for an Agent's lifetime; nothing writes |
| 4 | // it afterwards, which agent_config_test.go enforces. Embedded rather than |
| 5 | // nested so access stays flat, as perTurnState already does. Separating it lets |
| 6 | // the struct-state ratchet count reachable states instead of size: an immutable |
| 7 | // field combines with nothing. Anything that changes after New goes on Agent. |
| 8 | type agentConfig struct { |
| 9 | maxSteps int |
| 10 | maxStepsKey string |
| 11 | reasoningByteLimit int |
| 12 | maxOutputTokens int |
| 13 | temperature float64 |
| 14 | usageSource string |
| 15 | modelRef string |
| 16 | // workspaceID is a prompt-cache lineage component, so it must not move |
| 17 | // while an agent lives — a change would silently rekey the cache. |
| 18 | workspaceID string |
| 19 | // classifierTaskText is the host-trusted task text for delivery intent |
| 20 | // classification, set by sub-agent spawners whose Run input carries host |
| 21 | // framing. Empty means classify the raw input verbatim. |
| 22 | classifierTaskText string |
| 23 | // writeWorkspaceRoot scopes write reservations when writeScheduler is set. |
| 24 | writeWorkspaceRoot string |
| 25 | // subagentDepth caps delegation; at maxSubagentDepth the recursive |
| 26 | // agent/skill tools are excluded. |
| 27 | subagentDepth int |
| 28 | maxSubagentDepth int |
| 29 | // contextWindow and compactRatio decide when at most one provider-visible |
| 30 | // checkpoint is installed; recentKeep and archiveDir shape what it keeps. |
| 31 | contextWindow int |
| 32 | compactRatio float64 |
| 33 | recentKeep int |
| 34 | archiveDir string |
| 35 | } |
| 36 |