Skip to content

fix(update): codify Codex install-state repeatability - #430

Merged
joelteply merged 1 commit into
canaryfrom
fix/codex-update-force-install-state
May 2, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/codex-update-force-install-state

Conversation

@joelteply

@joelteply joelteply commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Codex dogfood exposed two install/update repeatability issues that should live in the public repo, not as local machine patches:

  • airc update --force advertised auto-stash, but cmd_update shifted all args before checking for --force, so the force flag was never observed. airc update --channel canary --force and airc update --force still refused over local tracked edits.
  • .channel is per-install release-channel state, but it was not ignored, so installed checkouts show dirty after normal airc channel canary / airc update use. That makes airc version report dirty for a clean install-state file.

Fix

  • Parse --force / -f in the main option loop before args are shifted away.
  • Add .channel to .gitignore.

Verification

  • bash -n lib/airc_bash/cmd_update.sh
  • git check-ignore -v .channel
  • Temp install-clone validation: dirty tracked README.md, .channel=canary, then airc update --channel canary --force auto-stashed successfully, stayed on canary, and refreshed both Claude Code and Codex skill symlinks with no .channel dirty status.

Codex CLI 0.128.0 dogfood catch while validating #428 / #422 Codex install path.

Copilot AI review requested due to automatic review settings May 2, 2026 19:45
@joelteply
joelteply merged commit d0d5c1e into canary May 2, 2026
8 checks passed
@joelteply
joelteply deleted the fix/codex-update-force-install-state branch May 2, 2026 19:46

Copilot AI 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.

Pull request overview

This PR tightens install/update repeatability for airc by fixing how cmd_update observes --force during argument parsing and by treating the per-install .channel state file as local install metadata instead of repository dirt. In the broader codebase, these changes improve the reliability of the release-channel/update flow that install.sh, airc update, airc channel, and airc version all share.

Changes:

  • Parse --force / -f in cmd_update’s main option loop so the flag still works after argument shifting.
  • Ignore the install-local .channel file in Git so normal channel changes no longer leave installed checkouts looking dirty.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/airc_bash/cmd_update.sh Moves --force handling into the primary update option parser so repeat updates can auto-stash as intended.
.gitignore Ignores the persisted channel-selection file to keep installed clones clean after normal channel operations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

;;
--canary) requested_channel="canary"; shift ;;
--main) requested_channel="main"; shift ;;
--force|-f) force=1; shift ;;
joelteply added a commit that referenced this pull request May 2, 2026
…ore additions (#431)

feat(logs): airc logs --since <ts|Ns|Nm|Nh> for incremental polling + Windows install-state .gitignore

## Why

Codex hit context exhaustion 2026-05-02 after a session where it polled
`airc logs N` on every prompt-cycle (the satellite-mode pattern from
the just-shipped peer-architecture discussion). N=50 = ~7K tokens
re-injected per turn → quadratic context burn.

Fix: incremental polling. Agents that re-poll the bus pass the ts of
their last-seen message and get only NEW events back. O(delta) per
turn instead of O(N).

## API

```
airc logs                    # tail 20 (default, unchanged)
airc logs 100                # tail 100 (unchanged)
airc logs --since 5m         # only msgs newer than 5min ago
airc logs --since 60s        # 60 seconds ago
airc logs --since 1h         # 1 hour ago
airc logs --since 2d         # 2 days ago
airc logs --since 2026-05-02T19:30:00Z   # ISO timestamp
airc logs 100 --since 5m     # tail 100 then filter (combine)
```

`--since` filters happen client-side after `tail -N` reads from
messages.jsonl. Agents using `--since` should pass a generous N
(e.g., 200) since old messages get filtered out — and use the ts of
their last-seen msg as the next call's --since.

Backward-compatible — `--since` is optional, no-arg behavior unchanged.
Bogus --since args fail with a clear error + exit 2.

## Verification (6/6 pass)

- backward compat (`logs 5`): ✓
- relative offset (`--since 5m`): ✓ (filtered to 3 recent)
- impossible window (`--since 1s`): ✓ (0 lines)
- bogus arg (`--since garbage`): ✓ ("cannot parse 'garbage'", exit 2)
- ISO timestamp (`--since 2026-05-02T19:50:00Z`): ✓
- `--help`: ✓ (clean usage)

## Bonus: 2 more files in .gitignore

b69f's Windows QA on #430 found 2 untracked install-state files at
repo root that still trigger `(dirty)` even after #430:

  - daemon.err (post-#421 daemon launcher stderr)
  - install-elevated.ps1 (Windows elevation helper from install.ps1)

Same fix-shape as #430's .channel: per-install runtime state, never
source. Folded into this PR rather than a one-line PR — both are
context-burn-related (clean version output is less context noise to
agents that grep for `(dirty)` as a signal).

## Pairs with

- #430 (.channel ignore — same shape, different files)
- #422 (canary→main bundle — this further hardens what ships)
- The ongoing "make airc reliable across all agent kinds" work — this
  is a Codex-discovered gap, fixed by an airc primitive that benefits
  every poll-mode consumer.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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