Update remaining commands to use env-aware role detection (gt-1xsah)
- mail.go: gt mail send --self uses GetRoleWithContext - molecule_attach.go: detectCurrentAgent uses GetRoleWithContext - molecule_attach_from_mail.go: uses GetRoleWithContext - molecule_lifecycle.go: burn/squash use GetRoleWithContext - rig.go: gt rig reset uses GetRoleWithContext All role detection now checks GT_ROLE env var first.
This commit is contained in:
@@ -30,11 +30,21 @@ func runMoleculeAttachFromMail(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("not in a Gas Town workspace")
|
||||
}
|
||||
|
||||
// Detect agent role and identity
|
||||
roleCtx := detectRole(cwd, townRoot)
|
||||
// Detect agent role and identity using env-aware detection
|
||||
roleInfo, err := GetRoleWithContext(cwd, townRoot)
|
||||
if err != nil {
|
||||
return fmt.Errorf("detecting role: %w", err)
|
||||
}
|
||||
roleCtx := RoleContext{
|
||||
Role: roleInfo.Role,
|
||||
Rig: roleInfo.Rig,
|
||||
Polecat: roleInfo.Polecat,
|
||||
TownRoot: townRoot,
|
||||
WorkDir: cwd,
|
||||
}
|
||||
agentIdentity := buildAgentIdentity(roleCtx)
|
||||
if agentIdentity == "" {
|
||||
return fmt.Errorf("cannot determine agent identity from current directory (role: %s)", roleCtx.Role)
|
||||
return fmt.Errorf("cannot determine agent identity (role: %s)", roleCtx.Role)
|
||||
}
|
||||
|
||||
// Get the agent's mailbox
|
||||
|
||||
Reference in New Issue
Block a user