Skip to content

fix: chat model switcher via websocket, entrypoint permissions, and docker compose fixes#657

Merged
yaojin3616 merged 1 commit into
mainfrom
fix/release-minor-fixes
Jun 7, 2026
Merged

fix: chat model switcher via websocket, entrypoint permissions, and docker compose fixes#657
yaojin3616 merged 1 commit into
mainfrom
fix/release-minor-fixes

Conversation

@yaojin3616

Copy link
Copy Markdown
Collaborator

Summary

This PR addresses minor release and deployment issues:

  1. Frontend model switcher: Uses WebSocket state (model_id payload) for session-specific model overrides rather than updating the agent's primary configuration globally via PATCH API.
  2. Backend entrypoint: Added ownership checking before recursive chown in entrypoint.sh to prevent performance overhead on large mounted directories.
  3. Docker Compose configurations: Fixed build contexts and added privileged: true for the backend service.

@yaojin3616 yaojin3616 merged commit 9974a78 into main Jun 7, 2026
1 check was pending
@yaojin3616 yaojin3616 deleted the fix/release-minor-fixes branch June 7, 2026 18:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7fb4f74407

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +2008 to +2010
const handleModelChange = useCallback((newModelId: string | null) => {
setOverrideModelId(newModelId);
if (!id || !newModelId || newModelId === agent?.primary_model_id) return;
if ((agent as any)?.access_level !== 'manage') return;
try {
await agentApi.update(id, { primary_model_id: newModelId });
queryClient.invalidateQueries({ queryKey: ['agent', id] });
} catch {
setOverrideModelId(agent?.primary_model_id || null);
}
}, [id, agent?.primary_model_id, (agent as any)?.access_level, queryClient]);
}, []);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Key the chat model override by session

When a user switches from one chat session to another on the same agent page, this unkeyed overrideModelId is carried over and sendChatMsg sends it as modelId, so a model selected for one session silently affects later messages in a different session. Since the picker is presented as a per-session switch, reset or store the override per activeSession.id when handling changes.

Useful? React with 👍 / 👎.

Comment thread backend/entrypoint.sh
Comment on lines +21 to +25
if [ -d "${TARGET_DIR}" ]; then
CURRENT_OWNER=$(stat -c '%U:%G' "${TARGET_DIR}" 2>/dev/null || echo "")
if [ "${CURRENT_OWNER}" != "clawith:clawith" ]; then
echo "[entrypoint] Directory ${TARGET_DIR} owner is '${CURRENT_OWNER}', fixing permissions..."
chown -R clawith:clawith "${TARGET_DIR}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep fixing child ownership, not just the parent

If the mounted agent data directory itself is already owned by clawith:clawith but any nested files or session/workspace subdirectories are still root-owned from a previous run, this new owner check skips the recursive chown and the process drops privileges before it can read/write those children. This regresses the old unconditional recursive fix for partially-owned volumes; check a representative writable child or still repair descendants when the tree is mixed.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant