Fix critical issues breaking task execution cycle

- Fix branch name validation by hashing peer IDs using SHA256
- Fix Hive API claiming error by using correct 'task_number' parameter
- Improve console app display with 300% wider columns and adaptive width
- Add GitHub CLI integration to sandbox with token authentication
- Enhance system prompt with collaboration guidelines and help escalation
- Fix sandbox lifecycle to preserve work even if PR creation fails

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-07-14 22:06:50 +10:00
parent 588e561e9d
commit d1d61c063b
7 changed files with 111 additions and 33 deletions

View File

@@ -2,6 +2,7 @@ package github
import (
"context"
"crypto/sha256"
"fmt"
"time"
@@ -321,9 +322,16 @@ func (c *Client) ListAvailableTasks() ([]*Task, error) {
return tasks, nil
}
// hashAgentID creates a short hash of the agent ID for safe branch naming
func hashAgentID(agentID string) string {
hash := sha256.Sum256([]byte(agentID))
return fmt.Sprintf("%x", hash[:8]) // Use first 8 bytes (16 hex chars)
}
// createTaskBranch creates a new branch for task work
func (c *Client) createTaskBranch(issueNumber int, agentID string) error {
branchName := fmt.Sprintf("%s%d-%s", c.config.BranchPrefix, issueNumber, agentID)
hashedAgentID := hashAgentID(agentID)
branchName := fmt.Sprintf("%s%d-%s", c.config.BranchPrefix, issueNumber, hashedAgentID)
// Get the base branch reference
baseRef, _, err := c.client.Git.GetRef(