Skip to content

fix: store an absolute cwd in session metadata - #221

Open
schickling-assistant wants to merge 3 commits into
mainfrom
schickling-assistant/2026-11-10-absolute-cwd
Open

schickling-assistant wants to merge 3 commits into
mainfrom
schickling-assistant/2026-11-10-absolute-cwd

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Problem

Relative cwd values such as . were copied into run metadata. After the daemon vanishes, worktree-reclaim tools cannot classify those records against an absolute worktree path.

Change

  • Validate the caller's original cwd spelling first, preserving existing existence/access checks and error text.
  • Resolve relative paths lexically with std::path::absolute, then freeze that cwd in the config before metadata publication or child creation, in both ordinary and operation-mode launches.
  • Leave absolute cwd strings unchanged, including symlink paths; no canonicalization.
  • Add a real-daemon regression for . and an absolute symlink path, plus validation-error coverage and README documentation.
  • No changes to status computation, GC, or existing records. This repo has no changelog; the behavior is documented in README.

Verification

Checks ran on Linux through the repository's nix develop shell with heavy-work admission. Final head: c2d8ac40d312b9043e2266448c3019540e452111.

Final-head raw results:

CHECK RESULT: cargo clippy --workspace --all-targets: exit 0
test launch_stores_an_absolute_cwd_without_resolving_symlinks ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 30 filtered out; finished in 0.04s
CHECK RESULT: cargo test -p pty --test daemon_lifecycle -- --exact --test-threads=1 launch_stores_an_absolute_cwd_without_resolving_symlinks: exit 0
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 57 filtered out; finished in 0.00s
CHECK RESULT: cargo test -p pty --bin pty daemon::env::tests:: -- --test-threads=1: exit 0

Formatting (repo Nix shell, rustc 1.97.0 / rustfmt 1.9.0):

CHECK RESULT: cargo fmt --all -- --check: exit 1
CHECK RESULT: scoped rustfmt --check: exit 1

The scoped command was rustfmt --check --edition 2024 --config skip_children=true on the four changed Rust files. Every reported formatting hunk is in existing, unchanged code; none is in this change's added/modified lines. Baseline formatting was not rewritten. CI treats formatting and clippy as reporting-only.

The complete affected-crate run on 30492ead7ce4180e7037be5bacab3b369db0c81d reported:

CHECK RESULT: cargo clippy --workspace --all-targets: exit 0
CHECK RESULT: cargo test -p pty --no-fail-fast -- --test-threads=1: exit 101

It failed four binaries. To distinguish regressions from baseline failures, each was also run on origin/main (d50ad1b3c839e49c8115e1d9cc93048e6252e090) on the same host and Nix shell, with --test-threads=1:

Binary Branch run origin/main comparison Classification
daemon_geometry 3 passed, 3 failed 3 passed, 3 failed; same WINCH-trap failures and listener EINVAL Fails on main too (pre-existing)
daemon_lifecycle 28 passed, 3 failed 28 passed, 2 failed; same shutdown/backstop failures Two fail on main too (pre-existing). Third was new-test fixture cleanup, fixed; final regression passes above.
daemon_roles 14 passed, 2 failed 14 passed, 2 failed; same redraw/READY failures and listener EINVAL Fails on main too (pre-existing)
interactive 6 passed, 1 failed 6 passed, 1 failed; same deleted-picker missing-file failure Fails on main too (pre-existing)

Raw baseline results:

CHECK RESULT: MAIN cargo test -p pty --test daemon_geometry -- --test-threads=1: exit 101
CHECK RESULT: MAIN cargo test -p pty --test daemon_lifecycle -- --test-threads=1: exit 101
CHECK RESULT: MAIN cargo test -p pty --test daemon_roles -- --test-threads=1: exit 101
CHECK RESULT: MAIN cargo test -p pty --test interactive -- --test-threads=1: exit 101

Earlier implementation check on efb192cf47bb84c5780c861480c297cbe43ab3a9 exposed a missing mutable worker binding, fixed in the next signed commit:

CHECK RESULT: cargo clippy --workspace --all-targets: exit 101
CHECK RESULT: cargo test -p pty --no-fail-fast -- --test-threads=1: exit 101

NOT RUN: complete affected-crate suite again after the test-only fixture correction; full workspace tests; release build; macOS checks; record migration/reclaim (out of scope).

Complexity and concerns

No new dependency or abstraction; a shared launch-time helper serves both launch modes. Existing formatting drift and the reproduced main-branch test failures remain visible above.

Friction

The regression initially reused a registry root that the daemon test harness deletes on drop; each case now owns a separate root. No production behavior was changed to accommodate the fixture.

Scope

No existing run records were modified. No migration or reclaim operation is included.

Posted on behalf of @schickling
field value
agent_identity unknown
session unknown
agent_persona unknown
agent_supervisor unavailable
agent_tool unknown
agent_tool_version unknown
agent_runtime unknown
agent_model unknown
worktree unknown

agent-identity: agent/compoundingtech/compounding-manager
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.12.5
agent-runtime: OMP 18.12.5
agent-model: openai-codex/gpt-6.1-sol
agent-identity: agent/compoundingtech/compounding-manager
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.12.5
agent-runtime: OMP 18.12.5
agent-model: openai-codex/gpt-6.1-sol
agent-identity: agent/compoundingtech/compounding-manager
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.12.5
agent-runtime: OMP 18.12.5
agent-model: openai-codex/gpt-6.1-sol
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