Final sweep: Crucible fixes, Path Tracer polish, forge progress, tests green.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Align dashboard subtitle default and UpsertAgent tests with fleet label behavior; WebSocket coalesce and PathForge hardening; Crucible expanded ops and visual DV fixes; Vitest 610/610 and full test-suite pass; trim PROBLEMS.md to open items only.
This commit is contained in:
@@ -688,11 +688,18 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// Connect to pool in background — do NOT block the auth_response.
|
||||
// The agent can start and the pool proxy will be ready by the time
|
||||
// the first share is submitted.
|
||||
// Once the pool is ready, push the current job so the agent starts
|
||||
// mining immediately instead of waiting for a get_job retry cycle.
|
||||
go func(pc pool.Config, bcs []pool.Config, aid string) {
|
||||
if _, err := h.poolManager.EnsurePoolWithBackups(&pc, bcs); err != nil {
|
||||
proxy, err := h.poolManager.EnsurePoolWithBackups(&pc, bcs)
|
||||
if err != nil {
|
||||
log.Printf("[WS] Pool init for agent %s failed (will retry): %v", aid, err)
|
||||
return
|
||||
}
|
||||
if job := proxy.GetCurrentJob(); job != nil {
|
||||
if wErr := h.writeAgentJSON(aid, Message{Type: "new_job", Payload: mustMarshal(job)}); wErr != nil {
|
||||
log.Printf("[WS] Push initial job to agent %s: %v", aid, wErr)
|
||||
}
|
||||
}
|
||||
}(poolCfg, backupCfgs, agentID)
|
||||
}
|
||||
@@ -794,10 +801,21 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
go h.runPingLoopAgent(ac)
|
||||
}
|
||||
|
||||
conn.WriteJSON(Message{Type: "auth_response", Payload: mustMarshal(map[string]interface{}{
|
||||
"success": true,
|
||||
"agent_id": agentID,
|
||||
})})
|
||||
conn.WriteJSON(Message{Type: "auth_response", Payload: mustMarshal(map[string]interface{}{
|
||||
"success": true,
|
||||
"agent_id": agentID,
|
||||
})})
|
||||
|
||||
// Auto-start mining: ensure the agent isn't stuck in a paused
|
||||
// state from a previous session. The agent's in-memory pause flag
|
||||
// resets on each restart, but sending resume is a cheap no-op and
|
||||
// guarantees hashing begins as soon as a job arrives.
|
||||
if h.agentPoolConfig(agentID).Wallet != "" {
|
||||
_ = h.writeAgentJSON(agentID, Message{
|
||||
Type: "command",
|
||||
Payload: mustMarshal(map[string]interface{}{"action": "resume"}),
|
||||
})
|
||||
}
|
||||
|
||||
// Enrich agent with hostname before broadcasting so the dashboard
|
||||
// immediately shows the correct machine-specific display name.
|
||||
|
||||
Reference in New Issue
Block a user