Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ set -euo pipefail
: "${GIT_USER_NAME:=${AGENT^} CoWork}"
: "${GIT_USER_EMAIL:=${AGENT}@prodromou.com}"

# Workspace defense — if the PVC's contents have stale ownership
# (e.g. pre-fsGroup pod created files as root), the agent user can't
# clone or write here. We can't chown across uids without root, but we
# can ensure ~/workspace exists, is owned by us, and is writable. Any
# stale subdirs will still error if the agent tries to write under them
# — the manifest carries fsGroupChangePolicy=Always to recursively
# repair on next mount; this block is defense-in-depth.
mkdir -p "${HOME}/workspace" 2>/dev/null || true
if [ -w "${HOME}/workspace" ]; then
chmod u+rwX "${HOME}/workspace" || true
else
echo "WARNING: ${HOME}/workspace is not writable. Falling back to /tmp/workspace." >&2
mkdir -p /tmp/workspace
cd /tmp/workspace
fi

# git identity + gh credential helper — set up early so the
# agent-config clone below can use it for private-repo HTTPS auth.
git config --global user.name "${GIT_USER_NAME}"
Expand Down
26 changes: 16 additions & 10 deletions profile/.bashrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# codex-cli pod bash profile.
# Multi-agent shell pod bash profile. Branding driven by $AGENT
# (set in the Dockerfile: codex|claude).

# Standard bashrc bits.
[ -z "$PS1" ] && return
Expand All @@ -21,19 +22,24 @@ alias gd='git diff'
alias gco='git checkout'
alias k='kubectl'

# Prompt: green hostname (codex-cli pod), cwd, git branch.
# Default $AGENT to "agent" if not set (e.g. local docker run without
# the build-time ENV propagating).
: "${AGENT:=agent}"

# Prompt: green agent@host, cwd, git branch.
parse_git_branch() {
git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1='\[\033[0;32m\]codex@\h\[\033[0m\]:\[\033[0;34m\]\w\[\033[0;35m\]$(parse_git_branch)\[\033[0m\]\$ '
PS1='\[\033[0;32m\]'"${AGENT}"'@\h\[\033[0m\]:\[\033[0;34m\]\w\[\033[0;35m\]$(parse_git_branch)\[\033[0m\]\$ '

# Show identity banner on login.
if [ -f "${HOME}/.codex-identity" ]; then
echo "──── codex-cli ────"
cat "${HOME}/.codex-identity"
# Show identity banner on login. The entrypoint writes ~/.${AGENT}-identity.
IDENTITY_FILE="${HOME}/.${AGENT}-identity"
if [ -f "${IDENTITY_FILE}" ]; then
echo "──── ${AGENT}-cli ────"
cat "${IDENTITY_FILE}"
echo "───────────────────"
echo " tmux → start a persistent session (survives tab close)"
echo " codex --help → codex-cli help"
echo " gh auth status → confirm github identity"
echo " tmux → start a persistent session (survives tab close)"
echo " ${AGENT} --help → ${AGENT}-cli help"
echo " gh auth status → confirm github identity"
echo
fi
Loading