Skip to content

Fix 0.8.1 follow-up regressions#149

Merged
qwrobins merged 2 commits into
mainfrom
codex/fix-145-148-followups
Jun 10, 2026
Merged

Fix 0.8.1 follow-up regressions#149
qwrobins merged 2 commits into
mainfrom
codex/fix-145-148-followups

Conversation

@qwrobins

@qwrobins qwrobins commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the four 0.8.0 follow-up issues:

  • classify Linear Entity not found failures as not-found, including bulk per-item failures and exit-code priority
  • compose global option groups across all command registrations and add a registry-wide leading --version / --metadata curated --json matrix test
  • keep issue list --search scoped to the profile default team while preserving workspace-wide issue search
  • preserve safe content negotiation headers across cross-host file redirects, narrow generated API RangeError validation handling, and restore schema missing-data responses to general failures

Verification

  • bun run typecheck
  • bun run test
  • bun run build

Fixes #145
Fixes #146
Fixes #147
Fixes #148

Summary by CodeRabbit

Release Notes v0.8.1

  • Bug Fixes
    • Improved mapping of entity-not-found failures (including per-item bulk failures) to not-found exit codes.
    • Restored team-default scoping for issue list --search.
    • Preserve safe headers while stripping auth/signed headers across cross-host upload redirects.
    • Refined RangeError/general error classification in API commands.
    • Treat missing introspection schema data as a general failure for schema pull/schema check.
    • Early short-circuit for --version and curated metadata options across commands.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6f175f19-7b2e-4ae4-a3ff-4a1129f613d7

📥 Commits

Reviewing files that changed from the base of the PR and between 52437b3 and d6df467.

📒 Files selected for processing (1)
  • src/core/registry/commands.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/core/registry/commands.ts

📝 Walkthrough

Walkthrough

This PR implements v0.8.1 with six behavioral fixes: GraphQL entity-not-found errors now map to the not-found exit code and category; command registrations consolidate with global option groups to enable --version and --metadata early exit across all commands; issue list --search restores default-team scoping; cross-host upload redirects preserve content-negotiation headers while dropping auth; API command RangeError handling is narrowed to retry normalization only; and schema introspection missing-data errors classify as general failures rather than validation errors.

Changes

GraphQL error classification, command registry consolidation, and command/schema refinements

Layer / File(s) Summary
GraphQL entity-not-found error classification
src/core/errors/command-failure.ts, tests/commands/issue.test.ts
New isGraphQLEntityNotFound helper detects entity-not-found patterns from GraphQL transport messages, nested errors, and extensions. mapCommandFailure maps those to ExitCode.NotFound / category: "not-found". Message-based heuristic added for generic Error instances; bulk-update test verifies per-item classification.
Command registry consolidation with OPTION_GROUPS.global
src/core/registry/commands.ts, tests/cli/main.test.ts
Refactor several command registrations (auth, gql, api, schema, workspace, skills) to spread OPTION_GROUPS.global (and ...OPTION_GROUPS.retry where applicable). Add test that iterates COMMAND_REGISTRY to assert leading --version and --metadata curated --json early-exit behavior with no network calls.
Issue list --search default-team scoping
src/commands/issue.ts, tests/commands/issue.test.ts
handleIssueSearch gains applyDefaultTeam parameter; issue list with --search calls handleIssueSearch(options, true) so profile default team is applied for list-based searches. Tests use DEFAULT_TEAM_ID constant and assert variables.filter.team is set.
Cross-host redirect header allowlist
src/commands/file.ts, tests/commands/file.test.ts
Add CROSS_HOST_HEADER_ALLOWLIST and safeCrossHostHeaders to retain allowlisted headers (e.g., Content-Type) when redirects change host while dropping authorization/signed-storage headers. Redirect-following logic applies filtered headers; test asserts Content-Type: image/png retained and x-amz-acl dropped.
API command RangeError handling refinement
src/commands/api.ts, tests/commands/api.test.ts
normalizeRetryOptions is performed inside its own try/catch so a RangeError there maps to emitValidationError; later catch no longer special-cases RangeError, letting fallbackCtx.emitCaughtError handle other runtime errors. Test verifies a RangeError thrown during execution/serialization is reported as category: "general" (exit 1).
Schema introspection missing-data error classification
src/commands/schema.ts, tests/commands/schema.test.ts
Introduce emitSchemaFailure(message, options) and route missing data.__schema cases in handleSchemaPull/handleSchemaCheck through it, emitting a general failure (ExitCode.GeneralError) via JSON envelope or stderr. Test asserts exit code 1 and category: "general" for missing schema data.
Version bump and CHANGELOG
package.json, CHANGELOG.md
Package version updated to 0.8.1. CHANGELOG adds 0.8.1 entry documenting the six behavioral fixes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through code with tiny paws,
Found lost errors and fixed their laws.
Headers kept, teams restored, ranges tamed —
Six little fixes, neatly named.
The rabbit nods: v0.8.1 proclaimed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix 0.8.1 follow-up regressions' clearly and concisely summarizes the main objective of the PR, which addresses multiple regression fixes from the 0.8.0/0.8.1 cycle.
Linked Issues check ✅ Passed The PR comprehensively addresses all coding requirements from linked issues #145-#148: classifying GraphQL entity-not-found errors as not-found [#145], composing global option groups across all command registrations with registry-wide tests [#146], restoring default team application to issue list --search [#147], and fixing cross-host redirect headers, RangeError handling, and schema error classification [#148].
Out of Scope Changes check ✅ Passed All changes are directly aligned with the stated PR objectives and the coding requirements from linked issues #145-#148; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-145-148-followups

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/core/registry/commands.ts (1)

332-336: ⚡ Quick win

Remove duplicate "api-url" from optionKeys.

Line 334 explicitly lists "api-url", but this key is already included in OPTION_GROUPS.global (line 332). While the parser should handle this gracefully, the duplication is redundant and could cause maintenance confusion.

♻️ Proposed fix
     optionKeys: [
       ...OPTION_GROUPS.global,
       "api-key-env", "api-key-stdin", "oauth",
-      "set-default", "remove-config", "api-url",
+      "set-default", "remove-config",
       "oauth-client-id", "callback-port", "no-browser",
     ],
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/registry/commands.ts` around lines 332 - 336, The optionKeys array
currently spreads OPTION_GROUPS.global and then redundantly lists "api-url"
again; remove the duplicate "api-url" string from the explicit list so the key
only comes from OPTION_GROUPS.global. Locate the array (the optionKeys/command
options definition that spreads OPTION_GROUPS.global) and delete the extra
"api-url" entry to eliminate redundancy.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/core/registry/commands.ts`:
- Around line 332-336: The optionKeys array currently spreads
OPTION_GROUPS.global and then redundantly lists "api-url" again; remove the
duplicate "api-url" string from the explicit list so the key only comes from
OPTION_GROUPS.global. Locate the array (the optionKeys/command options
definition that spreads OPTION_GROUPS.global) and delete the extra "api-url"
entry to eliminate redundancy.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f14a8fd1-317f-4d64-b5c5-dcceb9a56e36

📥 Commits

Reviewing files that changed from the base of the PR and between e3a3233 and 52437b3.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • package.json
  • src/commands/api.ts
  • src/commands/file.ts
  • src/commands/issue.ts
  • src/commands/schema.ts
  • src/core/errors/command-failure.ts
  • src/core/registry/commands.ts
  • tests/cli/main.test.ts
  • tests/commands/api.test.ts
  • tests/commands/file.test.ts
  • tests/commands/issue.test.ts
  • tests/commands/schema.test.ts

@qwrobins qwrobins merged commit a70ddd1 into main Jun 10, 2026
2 checks passed
@qwrobins qwrobins deleted the codex/fix-145-148-followups branch June 10, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment