overnight-worktree-uv-warmup-and-log-path-guardrails

Prevent false stalls and missing-log failures in overnight Codex worktree batches by pre-warming uv environments, using exact log-path directory creation, and interpreting buffered logs correctly.

5 stars

Best use case

overnight-worktree-uv-warmup-and-log-path-guardrails is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Prevent false stalls and missing-log failures in overnight Codex worktree batches by pre-warming uv environments, using exact log-path directory creation, and interpreting buffered logs correctly.

Teams using overnight-worktree-uv-warmup-and-log-path-guardrails should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/overnight-worktree-uv-warmup-and-log-path-guardrails/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/workspace-hub-learned/overnight-worktree-uv-warmup-and-log-path-guardrails/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/overnight-worktree-uv-warmup-and-log-path-guardrails/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How overnight-worktree-uv-warmup-and-log-path-guardrails Compares

Feature / Agentovernight-worktree-uv-warmup-and-log-path-guardrailsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Prevent false stalls and missing-log failures in overnight Codex worktree batches by pre-warming uv environments, using exact log-path directory creation, and interpreting buffered logs correctly.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Overnight worktree uv warmup and log-path guardrails

Use when launching unattended Codex runs in fresh worktrees, especially for Python repos that rely on `uv` and for nested repos like `digitalmodel`.

## Trigger
- Overnight/background Codex batch in isolated worktrees
- Fresh worktree or fresh workspace
- Commands will run `uv run ...`
- You want reliable log capture with `tee`

## Problem patterns observed

1. `uv` first-run warmup can look like a hang
- In a fresh worktree, the first meaningful `uv run ...` can spend 55-60 minutes compiling/importing before useful output appears.
- This can make a healthy worker look blocked or dead.
- We observed this in the `digitalmodel` overnight lane: the real work eventually completed and all tests passed, but the first-use warmup consumed most of the apparent runtime.

2. Buffered Codex logs can stay empty for a long time
- `Codex -p ... | tee <log>` may produce no visible log growth for a long period even when the process is healthy.
- Empty logs are not sufficient evidence of failure.

3. `tee` can fail if you create the wrong log directory
- `mkdir -p logs && ... | tee /abs/path/to/logs/run.log` is unsafe if the actual `tee` target differs from the cwd-relative `logs/` you created.
- In the `digitalmodel` overnight lane, the command completed the task but still exited non-zero because `tee` could not open the intended log path.

## Recommended launch pattern

### 1. Pre-warm uv in the exact worktree
Before the real workload, run a disposable warmup in the same worktree:

```bash
uv run python -c "pass"
```

Use this especially when:
- the worktree is fresh
- the repo is large
- the lane is test-heavy
- the first useful command is a long pytest run

### 2. Create the exact log directory for the exact log file
Do not rely on `mkdir -p logs` unless `tee` writes to `./logs/...` in that same cwd.

Safe pattern:

```bash
LOG=/abs/path/to/logs/run.log
mkdir -p "$(dirname "$LOG")"
PROMPT=$(< /abs/path/to/prompt.md)
Codex -p \
  --permission-mode acceptEdits \
  --no-session-persistence \
  --output-format text \
  --max-turns 80 \
  "$PROMPT" </dev/null | tee "$LOG"
```

### 3. Monitor health by process state and artifacts, not log growth alone
Preferred signals:
- background PID still alive
- expected output/result artifacts appear
- worktree `git status --short` changes as files are written

Only treat the run as failed after checking those, not merely because the log is empty.

## Recovery pattern when a run exits non-zero after doing useful work
If the background command ends with a logging-related error:
1. inspect the worktree, not just the exit code
2. check `git status --short`
3. inspect target files and test outputs
4. verify whether the actual task completed despite the shell/logging failure
5. if yes, continue from the resulting repo state and post the correct GitHub update

## Practical rule
For overnight worktree batches:
- pre-warm `uv`
- use absolute log paths
- create the exact parent directory of the log file
- do not interpret empty Codex logs as immediate failure

These guardrails reduce false hang diagnoses and prevent task-success/logging-failure confusion in unattended runs.

Related Skills

digitalmodel-worktree-test-execution-with-shared-venv

5
from vamseeachanta/workspace-hub

Run digitalmodel tests from isolated worktrees without uv editable-dependency failures by using the main repo's existing virtualenv and PYTHONPATH.

blender-worktree-test-hardening

5
from vamseeachanta/workspace-hub

Recover and harden digitalmodel Blender automation work in isolated worktrees when uv/editable dependency paths break and local machines lack a Blender executable.

worktree-pre-push-bypass-for-tier1-checks

5
from vamseeachanta/workspace-hub

Handle workspace-hub integration-branch pushes from isolated git worktrees when the pre-push hook incorrectly assumes sibling tier-1 repos exist under the worktree path.

worktree-branch-sync-hygiene

5
from vamseeachanta/workspace-hub

Class-level branch, worktree, dirty-main, stash, sync, and hook hygiene for workspace-hub style multi-repo work.

workspace-hub-overnight-plan-monitor

5
from vamseeachanta/workspace-hub

Monitor and reconcile workspace-hub overnight planning or implementation batches, including process status, result artifacts, issue/commit verification, and controlled failed-lane recovery.

python-import-path-mismatch-debugging

5
from vamseeachanta/workspace-hub

Diagnose and fix ModuleNotFoundError when a package is installed but imports still fail due to environment/path mismatches

python-import-path-debugging

5
from vamseeachanta/workspace-hub

Diagnose ModuleNotFoundError when a package is installed but still fails to import

git-worktree-cleanup-at-scale

5
from vamseeachanta/workspace-hub

Identify and remove stale git worktrees blocking branch deletion in multi-repo environments

git-worktree-cleanup-and-branch-reconciliation

5
from vamseeachanta/workspace-hub

Systematic process for cleaning up stale git worktrees, resolving merge conflicts in diverged branches, and reconciling branch state across multiple repositories.

git-worktree-cleanup-and-branch-hygiene

5
from vamseeachanta/workspace-hub

Systematic approach to cleaning up stale git worktrees, orphan branches, and branch hygiene at scale across multiple repos

learned-git-worktree-hook-path-and-real-hook-shape-review

5
from vamseeachanta/workspace-hub

Catch hook-installation and governance bugs that only appear in linked git worktrees or against the real generated hook shape, not simplified test fixtures.

clean-worktree-integration-from-dirty-main

5
from vamseeachanta/workspace-hub

Land validated issue work from isolated worktrees when the main checkout is dirty by creating a fresh integration worktree, cherry-picking only implementation commits, re-running combined validation, and preparing push/closeout artifacts.