8000 fix: v0.10.1 — realistic time-box defaults; find the worker's worktree without cd by adeelahmad · Pull Request #4 · adeelahmad/aloop · GitHub
[go: up one dir, main page]

Skip to content

fix: v0.10.1 — realistic time-box defaults; find the worker's worktree without cd - #4

Merged
adeelahmad merged 1 commit into
masterfrom
claude/agent-tools-sprint-planning-rpmkh3
Sep 23, 2026
Merged

adeelahmad merged 1 commit into
masterfrom
claude/agent-tools-sprint-planning-rpmkh3

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Problem (reported from a real sprint)

Fifteen RED/GREEN worker attempts died with zero commits, for two reasons.

  1. The defaults were too tight. The limits were 40k soft / 60k hard tokens. A real TDD attempt reads the style guide, runs gofmt/vet/lint/build/test and writes a report, and that uses 60–190k tokens even when it succeeds. Workers were stopped before writing a line.
  2. The per-task override was never found. The budget hook located the worker's worktree from the tool call's cwd. Workers that use git -C <wt> or absolute paths, instead of cd-ing into the worktree, always reported the main repo as their cwd. So the hook never read the worktree's .agentic/task.env (BUDGET_*) and applied the tiny default for the whole attempt.

The workaround at the time was a repo-level docs/agents/defaults.md, which resolves against the main tree.

Fix

New defaults: 150k / 250k tokens, 20 / 30 min.

Worktree discovery (budget → find_worktree) checks these in order:

  1. A recorded binding.
  2. The paths the tool call names: -C, cd, --work-tree, absolute paths, file_path, patch headers.
  3. The call's cwd.
  4. For a first call that only reads main-tree files: the single unclaimed worktree whose task.env names this role.

The winning worktree is remembered for the rest of the attempt.

Late discovery: if the worktree is found after the first call, the budget is re-resolved without resetting the attempt's clock. A hard verdict reached under the wrong budget is withdrawn, and its marker is removed.

Diagnostics:

  • budget status shows each attempt's budget source (tasks.md line, task.env, defaults.md or built-in) and how its worktree was found.
  • budget resolve --worktree WT prints the source too.
  • Soft and hard messages name the source.

Test plan

  • New regression test scripts/test/budget-worktree.test.py, 7 checks. It covers git -C from the main repo, absolute paths, a first read of a main-tree file, late discovery (clock kept, hard verdict withdrawn), the status output, and project-wide defaults.md.
  • make ci (Rust, shellcheck, Python compile check, evals, host tests: 7 + 15 + 18 checks) and claude plugin validate --strict

🤖 Generated with Claude Code

https://claude.ai/code/session_01YRfiFoSvw3SH9hJZqPhhYK


Generated by Claude Code

…e without cd

- Defaults 40k/60k tokens, 10/15 min killed real RED/GREEN attempts (60–190k even on
  success) before they wrote a line; now 150k/250k tokens, 20/30 min.
- The budget hook located the worker's worktree from the tool call's cwd only, so a
  worker using `git -C <wt>` / absolute paths from the main repo never had its
  .agentic/task.env override applied. It now finds the worktree from a binding, the
  paths the call names, the cwd, or the single unclaimed worktree for the role, and
  re-resolves the budget when it becomes known (clock kept; a hard verdict reached
  under the wrong budget is withdrawn).
- `budget status` / `budget resolve` / budget messages show where the budget came from.
- Regression test scripts/test/budget-worktree.test.py, run in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YRfiFoSvw3SH9hJZqPhhYK
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@adeelahmad
adeelahmad merged commit 74f9d20 into master Sep 23, 2026
4 checks passed
adeelahmad pushed a commit that referenced this pull request Oct 18, 2026
…rs to the gate's suppression check (run 22)

e2e-live.sh (#38) passed the Claude prompt as an argument after --allowedTools, which takes
every following word, so `claude -p` got no prompt and exited in 2s ("Input must be
provided"). The prompt goes on stdin again; --dry-run says so (test: e2e-live-hosts).

Live run 22 (wordfreq, 361f8d7): 13/13, 16m18s, $1.14, 2 wakes, 0 plugin reads, 3 blocks.
The final-gate persona failed the sprint on RED's #![allow(dead_code)] in tests/common/mod.rs
by its own open-ended grep, costing a GREEN re-dispatch. The persona now names exactly
assert_no_suppression's patterns and defers to `selfcheck final-gate` (test:
suppression-contract.test.py; eval final-gate #4). Ledger, ROADMAP M0.8, TRACKING, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QxyVf3NgwsgRyYpBgDDTC
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.

2 participants

0