Skip to content

fix: initialize installer manifest helper before codex install#82

Merged
accesswatch merged 1 commit intoCommunity-Access:mainfrom
Orinks:fix/codex-installer-manifest-bug
Mar 22, 2026
Merged

fix: initialize installer manifest helper before codex install#82
accesswatch merged 1 commit intoCommunity-Access:mainfrom
Orinks:fix/codex-installer-manifest-bug

Conversation

@Orinks
Copy link
Copy Markdown
Contributor

@Orinks Orinks commented Mar 19, 2026

Summary

  • fix the installer bug where install.sh --global --codex could fail with add_manifest_entry: command not found
  • initialize the manifest helper before any installer path can call it
  • ensure fresh global installs create the target directory before touching the manifest

Root cause

The Codex install path called add_manifest_entry, but that helper was defined later inside the Claude file-copy branch. On global/plugin installs, that branch was skipped, so the function never existed when Codex tried to use it.

Moving the helper earlier exposed a second issue on fresh global installs: the target directory needed to be created before the manifest file could be touched.

Verification

I verified the relevant installer paths against this branch non-interactively:

  • bash install.sh --global
  • bash install.sh --project
  • bash install.sh --global --codex
  • bash install.sh --project --codex
  • bash install.sh --global --gemini
  • bash install.sh --project --gemini
  • bash install.sh --global --cli
  • bash install.sh --project --cli

All eight completed with exit status 0.

For the Codex paths, I also verified that the install produced:

  • .codex/AGENTS.md
  • .codex/config.toml
  • .codex/roles/ with all role files
  • correct manifest entries for Codex config, roles, install scope, and AGENTS path

Scope

Tight fix to installer execution order and target-dir initialization only. No unrelated cleanup.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an installer execution-order bug where the --codex path could call add_manifest_entry before it was defined, particularly in global/plugin installs, and ensures the target directory exists before manifest operations.

Changes:

  • Initialize the installer manifest (and add_manifest_entry helper) immediately after TARGET_DIR is determined.
  • Ensure fresh installs create $TARGET_DIR before touching the manifest.
  • Remove the now-redundant manifest/helper definition from the later file-copy branch.

Comment thread install.sh
# including global/plugin installs that bypass the Claude file-copy branch.
mkdir -p "$TARGET_DIR"
MANIFEST_FILE="$TARGET_DIR/.a11y-agent-manifest"
touch "$MANIFEST_FILE"
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating/touching the manifest unconditionally here changes later control flow: cleanup_old_install() (used during global plugin installs) currently runs whenever ~/.claude/.a11y-agent-manifest exists, so this new touch makes it run (and delete the manifest) even on fresh plugin installs, showing a misleading cleanup message. Consider making cleanup_old_install require a non-empty/valid manifest (e.g., -s or pattern check) or making add_manifest_entry create/touch the manifest lazily so the presence check still reflects a previous non-plugin install.

Suggested change
touch "$MANIFEST_FILE"

Copilot uses AI. Check for mistakes.
Comment thread install.sh
Comment on lines +207 to +210
add_manifest_entry() {
local entry="$1"
grep -qxF "$entry" "$MANIFEST_FILE" 2>/dev/null || echo "$entry" >> "$MANIFEST_FILE"
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that add_manifest_entry is defined globally, any later checks that use “function exists” as a proxy for “file-copy install happened” will always pass. In particular, the install-scope recording near the end of the script will now always write to the manifest (including plugin-only installs), which seems to contradict its comment and prior behavior. Suggest switching that guard to an explicit state flag (e.g., PLUGIN_INSTALL / FILE_COPY_INSTALL) or checking for expected manifest entries instead of testing for the function.

Copilot uses AI. Check for mistakes.
@accesswatch accesswatch merged commit 6df6ace into Community-Access:main Mar 22, 2026
4 checks passed
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.

3 participants