Skip to content

Commit c0a9ef4

Browse files
committed
agents: drop the dead type enum
agents.<name>.type (assistant|coding|research) was validated, stored, and displayed — and consumed by nothing. Neither Hermes nor OpenClaw has role enums: the standard both share is identity as prose (SOUL.md) plus behavior as real config (model, reasoning). We have both; the role menu was a third concept that changed nothing and invited users to deliberate over a choice with no effect. Removed pre-adoption; unknown yaml keys are ignored on load, so an existing config with type: still parses. The admin overview now shows the knobs that do exist (model, reasoning) instead.
1 parent d985675 commit c0a9ef4

5 files changed

Lines changed: 15 additions & 17 deletions

File tree

cmd/admin_tools.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,15 @@ func adminOverview(ctx context.Context) (string, error) {
130130
}
131131
sort.Strings(agentNames)
132132
for _, name := range agentNames {
133-
fmt.Fprintf(&b, "- %s: type=%s (home: ~/.memcode/agents/%s)\n", name, settings.Agents[name].Type, name)
133+
a := settings.Agents[name]
134+
extra := ""
135+
if a.Model != "" {
136+
extra += " model=" + a.Model
137+
}
138+
if a.Reasoning != "" {
139+
extra += " reasoning=" + a.Reasoning
140+
}
141+
fmt.Fprintf(&b, "- %s:%s (home: ~/.memcode/agents/%s)\n", name, extra, name)
134142
}
135143
b.WriteString("\nSCHEDULES:\n")
136144
if len(settings.Schedules) == 0 {
@@ -401,7 +409,6 @@ func adminAgent(input json.RawMessage) (string, error) {
401409
var in struct {
402410
Action string `json:"action"`
403411
Name string `json:"name"`
404-
Type string `json:"type"`
405412
Model string `json:"model"`
406413
Reasoning string `json:"reasoning"`
407414
}
@@ -419,24 +426,17 @@ func adminAgent(input json.RawMessage) (string, error) {
419426
}
420427
switch action {
421428
case "add":
422-
typ := strings.TrimSpace(in.Type)
423-
if typ == "" {
424-
typ = "assistant"
425-
}
426-
if typ != "assistant" && typ != "coding" && typ != "research" {
427-
return "", fmt.Errorf("type must be assistant, coding, or research")
428-
}
429429
if settings.Agents == nil {
430430
settings.Agents = map[string]gwconfig.Agent{}
431431
}
432432
if r := strings.TrimSpace(in.Reasoning); r != "" && r != "off" && r != "medium" && r != "high" {
433433
return "", fmt.Errorf("reasoning must be off, medium, or high")
434434
}
435-
settings.Agents[name] = gwconfig.Agent{Type: typ, Model: strings.TrimSpace(in.Model), Reasoning: strings.TrimSpace(in.Reasoning)}
435+
settings.Agents[name] = gwconfig.Agent{Model: strings.TrimSpace(in.Model), Reasoning: strings.TrimSpace(in.Reasoning)}
436436
if err := gwconfig.Save(settings); err != nil {
437437
return "", err
438438
}
439-
return fmt.Sprintf("Created agent %s (type %s). Bind a channel to it with gw_channel field=agent; its standing instructions live at ~/.memcode/agents/%s/MEMCODE.md.", name, typ, name), nil
439+
return fmt.Sprintf("Created agent %s. Bind a channel to it with gw_channel field=agent; its identity lives at ~/.memcode/agents/%s/SOUL.md.", name, name), nil
440440
case "reasoning":
441441
p, ok := settings.Agents[name]
442442
if !ok {

cmd/migrate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func runMigration(cmd *cobra.Command, src migrationSource) error {
260260
cur.Agents = map[string]gwconfig.Agent{}
261261
}
262262
if _, ok := cur.Agents[id]; !ok {
263-
cur.Agents[id] = gwconfig.Agent{Type: "assistant"}
263+
cur.Agents[id] = gwconfig.Agent{}
264264
if err := gwconfig.Save(cur); err != nil {
265265
res.Notes = append(res.Notes, fmt.Sprintf("identity: agent %q written but not registered: %v", id, err))
266266
}
@@ -297,7 +297,7 @@ func runMigration(cmd *cobra.Command, src migrationSource) error {
297297
if cur.Agents == nil {
298298
cur.Agents = map[string]gwconfig.Agent{}
299299
}
300-
cur.Agents[id] = gwconfig.Agent{Type: "assistant"}
300+
cur.Agents[id] = gwconfig.Agent{}
301301
if err := gwconfig.Save(cur); err != nil {
302302
res.Notes = append(res.Notes, fmt.Sprintf("agent memory: memory written but agent %q not registered: %v", id, err))
303303
}

docs/gateway/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ projects: # written by `memcode project add`
9191
www: { path: ~/github/www, enabled: true }
9292
default_project: memcode
9393
agents: # durable agents; identity + state in ~/.memcode/agents/<id>
94-
personal: { type: assistant }
95-
coder: { type: coding }
94+
personal: {}
95+
coder: { model: claude-sonnet-5, reasoning: medium }
9696
schedules:
9797
- name: standup
9898
cron: "0 9 * * 1-5" # or every: "24h"

internal/agent/tools/admin.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ func AdminDefs() []wire.ToolDef {
5656
InputSchema: obj(map[string]any{
5757
"action": str("add, remove, model, or reasoning"),
5858
"name": str("agent name, e.g. personal, coder, researcher"),
59-
"type": str("add only: assistant (default), coding, or research"),
6059
"model": str("add/model: pin the model that drives this agent everywhere (catalog id, e.g. \"claude-sonnet-5\"); empty = automatic routing"),
6160
"reasoning": str("add/reasoning: pin thinking effort — off, medium, or high; empty = per-turn automatic"),
6261
}, "action", "name"),

internal/gateway/config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ type Settings struct {
9696
// a project and NOT the `memcode run` CLI command — the agent's context is
9797
// composed and handed to the coding engine as generic supplemental context.
9898
type Agent struct {
99-
Type string `yaml:"type,omitempty"` // assistant | coding | research (coarse behavior hint)
10099
// Model pins the model that drives this agent (an id from the catalog,
101100
// e.g. "claude-sonnet-5"). Empty = automatic routing. Wherever the agent
102101
// answers — any channel, any schedule — this is the model that serves it.

0 commit comments

Comments
 (0)