Skip to content

fix(offering): preserve isHidden state during headless offering update - #109

Open
shriyashsoni wants to merge 1 commit into
Virtual-Protocol:mainfrom
shriyashsoni:fix/offering-update-preserve-hidden
Open

shriyashsoni wants to merge 1 commit into
Virtual-Protocol:mainfrom
shriyashsoni:fix/offering-update-preserve-hidden

Conversation

@shriyashsoni

@shriyashsoni shriyashsoni commented Oct 22, 2026 •

Copy link
Copy Markdown

🎯 Summary

Fixes #78. Prevents acp offering update from unintentionally resetting isHidden to false when updating an offering non-interactively via flags.


🔍 Problem & Root Cause

When executing an update command in headless / non-interactive mode:

acp offering update --offering-id <id> --name "Updated Offering Name"
  1. opts.hidden is undefined.
  2. The CLI constructs updates without an isHidden key.
  3. An HTTP PUT /agents/:agentId/offerings/:offeringId request is sent with the partial payload.
  4. Because the API uses PUT semantics, omitted boolean fields default to false on the server.
  5. Impact: A storefront offering that was deliberately parked/hidden silently becomes public to buyers during minor edits.

🛠️ Solution

  • In non-interactive mode (--offering-id), explicitly carry over selected.isHidden into the update body when neither --hidden nor --no-hidden is supplied.
  • Preserves the merchant's intended visibility across automated deployments and scripts.

🧪 Verification

  • Verified non-interactive update preserves existing isHidden: true value when --hidden flag is omitted.
  • Verified explicit --no-hidden correctly unhides as expected (isHidden: false).
  • Verified interactive mode (rl prompt) retains Enter-to-keep behavior.
  • Passed npm run typecheck (tsc --noEmit)
  • Passed npm run build

Note

Low Risk
Small CLI fix that preserves existing visibility on partial updates; reduces accidental public exposure rather than changing auth or core API behavior.

Overview
Fixes headless acp offering update (with --offering-id) unintentionally clearing hidden visibility when --hidden / --no-hidden are omitted.

When opts.hidden is unset and the command runs non-interactively, the update payload now sets isHidden to the offering’s current value (selected.isHidden) instead of leaving the field out. That avoids server-side PUT behavior that treated a missing boolean as false and could expose previously hidden offerings during scripted edits.

Interactive updates are unchanged: users still only change hidden status when they answer the prompt with y or n.

Reviewed by Cursor Bugbot for commit 7f8dd64. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

offering update resets isHidden to false (full-object update with defaults)

1 participant