Introduce auth for codex/claude code & Fix agent not receiving messages after server restarted#24
Conversation
| } | ||
| } | ||
|
|
||
| func (h *Handler) replayRecentPicoClawMessages(botID string) { |
There was a problem hiding this comment.
How can we ensure that replayed messages do not get duplicated before and after the server restarts?
There was a problem hiding this comment.
Fixed: Replay finds that message ID in persisted IM history, uses its timestamp as a cursor, and skips messages at or before it.
| Usage: | ||
|
|
||
| ```bash | ||
| csgclaw auth login <provider> [flags] |
There was a problem hiding this comment.
Since it has nothing to do with csgclaw's own auth, it is suggested to change the command to: csgclaw model auth login.
Reference: OpenClaw Auth profiles.
There was a problem hiding this comment.
My mind: too ugly long.
My hand: fix without question.
There was a problem hiding this comment.
Personally, I think csgclaw model auth is sufficient. There's no need to add "login" unless there's a "logout" action.
There was a problem hiding this comment.
Maybe we will add it in the future, so be it.
There was a problem hiding this comment.
auth/auth.go/auth_test.go => model/model.go/model_test.go?
There was a problem hiding this comment.
Done, plus adding shell completion subcommand.
|
|
||
| _, _ = io.WriteString(w, ": connected\n\n") | ||
| flusher.Flush() | ||
| h.replayRecentPicoClawMessages(botID, r.Header.Get("Last-Event-ID")) |
There was a problem hiding this comment.
Where does this Last-Event-Id come from?
There was a problem hiding this comment.
it’s expected from the PicoClaw SSE client / EventSource implementation. It's a standard header for SSE protocol.[1]
There was a problem hiding this comment.
OK, so this is partially done. PicoClaw will need to be adjusted later to match it.
|
LGTM (will merge it once the conflict's fixed). |
…es after server restarted
|
Conflict fixed |
|
|
@RussellLuo Fixed gateway.log mounting problem |
| hostPath: hostWorkspaceRoot, | ||
| guestPath: boxWorkspaceDir, | ||
| hostPath: hostConfigRoot, | ||
| guestPath: boxPicoClawDir, |
There was a problem hiding this comment.
Per the previous discussion, here we should not mount the hostConfigRoot anymore?
There was a problem hiding this comment.
Let's leave the mount for hostWorkspaceRoot as it is for now.
| hostPath: projectsRoot, | ||
| guestPath: boxProjectsDir, | ||
| }, | ||
| } |
There was a problem hiding this comment.
Why delete projectsRoot? This directory’s supposed to let all agents see the same shared projects folder, otherwise they can’t share build outputs at all!
There was a problem hiding this comment.
My bad, mis-deleting, reverted.
| if strings.TrimSpace(template) == "" { | ||
| return "", fmt.Errorf("workspace template is required") | ||
| } | ||
| if err := migrateLegacyAgentWorkspace(agentName, hostRoot); err != nil { |
There was a problem hiding this comment.
Performing migration here doesn’t make sense:
- Right now, only when we create an agent do we call
ensureAgentWorkspace(), and at that point the agent usually doesn’t even exist (or it got deleted already); - Even if it does migrate successfully, the
copyEmbeddedWorkspace()step is just gonna overwrite everything right after anyway.
There was a problem hiding this comment.
Good gotcha, fixed.
Summary
csgclaw serverestart by reconnecting/recreating agent gateways, retrying transient BoxLite runtime-lock failures, and replaying missed PicoClaw messages.