Skip to content

calendar update: malformed nonblank attendee input becomes an attendee-clear patch #1330

Closed

Description

@pkyIntelligence

Explicit empty attendee clearing works after #1273. A nonblank value that contains no attendee, such as --attendees=';optional', also takes that clear path. A typo can therefore become a request to remove the current attendee list.

At current main e8428c36dd31db13eecba55fcef6f4ee75951188 (after v0.48.0), applyUpdateAttendees calls buildAttendees, then force-sends an empty attendee list whenever parsing yields none. parseAttendee discards ;optional because the address before the semicolon is empty.

Credential-free reproduction from that checkout (no Google call):

cat > internal/cmd/attendee_clear_probe_test.go <<'GO'
package cmd

import (
    "encoding/json"
    "io"
    "testing"
    "github.com/alecthomas/kong"
)

func TestAttendeeClearProbe(t *testing.T) {
    c := &CalendarUpdateCmd{}
    parser, err := kong.New(c, kong.Writers(io.Discard, io.Discard))
    if err != nil { t.Fatal(err) }
    parsed, err := parser.Parse([]string{"primary", "synthetic-event", "--attendees=;optional"})
    if err != nil { t.Fatal(err) }
    patch, changed, err := buildCalendarUpdatePatch(calendarUpdateInputFromCommand(c), calendarUpdateFieldsFromKong(parsed))
    if err != nil { t.Fatal(err) }
    wire, err := json.Marshal(patch)
    if err != nil { t.Fatal(err) }
    t.Logf("changed=%v patch=%s", changed, wire)
    if string(wire) == `{"attendees":[]}` {
        t.Fatal("nonblank malformed attendee input became a clear patch")
    }
}
GO
DBUS_SESSION_BUS_ADDRESS=disabled: GOG_KEYRING_BACKEND=file go test -vet=off -count=1 ./internal/cmd -run '^TestAttendeeClearProbe$' -v
rm internal/cmd/attendee_clear_probe_test.go

Observed by running the probe at that upstream commit: changed=true patch={"attendees":[]}; the regression assertion fails. Expected: reject a nonblank value that parses to no attendees; keep explicit empty or whitespace-only clearing working. No live Calendar mutation is needed to demonstrate the malformed patch.

Related open PR #1181 adds validation for its new MCP literal-attendee arrays. Its shared CLI patch builder still force-sends an empty list when legacy --attendees parsing yields nobody, so this report concerns the existing CLI path. This PR-head assessment is from source review, not an executed PR-head test.

Would you like a small standalone fix for this? We have a downstream guard that distinguishes deliberate empty input from nonblank input that parses to nobody.

Investigated and reproduced with AI assistance (the Astrarch agent team); the reproduction was verified on a real host.

Activity

  1. added
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    P2Normal priority bug or improvement with limited blast radius.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    impact:data-lossThis issue is about lost, corrupted, or silently dropped user/session/config data.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    no-staleExempts this issue from stale automation.
    and removed
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    on Nov 11, 2026
  2. clawsweeper commented on Nov 11, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep open: current main and v0.48.0 convert malformed nonblank attendee input into an explicit attendee-clear patch, and no open fix owns this defect.

    Reproducibility: yes. through current source: --attendees=';optional' is present, parses to zero attendees, and triggers forced empty-array serialization; the reporter supplies a failing probe, which this read-only review did not execute.

    Regression provenance
    Possible regression — suspected (reviewed change). No predecessor PR is attributed.

    Next step
    Add an attendee-update validation guard and establish a failing regression for modifier-only input while retaining empty and whitespace-only clears.

    Review details

    Best possible solution:

    Reject nonblank replacement input that yields zero attendees before mutation, preserving omitted flags, deliberate clears, and valid attendee modifiers.

    Do we have a high-confidence way to reproduce the issue?

    Yes, through current source: --attendees=';optional' is present, parses to zero attendees, and triggers forced empty-array serialization; the reporter supplies a failing probe, which this read-only review did not execute.

    Is this the best way to solve the issue?

    A guard in the shared update patch builder is a focused repair because it can return a usage error before mutation while retaining the tested empty-clear contract.

    AGENTS.md: found and applied where relevant.

    Codex review notes: model internal, reasoning medium; reviewed against e8428c36dd31.

    Label changes

    Label changes:

    • add P2: A narrow malformed CLI input can produce a destructive Calendar update, but no widespread incident or urgent workflow outage is established.
    • add impact:data-loss: A modifier-only typo produces a patch that removes the existing attendee list.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P2: A narrow malformed CLI input can produce a destructive Calendar update, but no widespread incident or urgent workflow outage is established.
    • impact:data-loss: A modifier-only typo produces a patch that removes the existing attendee list.
    Evidence reviewed

    Acceptance criteria:

    • go test ./internal/cmd -run 'TestCalendarUpdateExplicitEmptyFieldsJSON|TestCalendarUpdateBuildPatch|TestCalendarUpdateMalformedAttendees' -count=1
    • go test ./internal/cmd -run 'TestCalendarUpdate|TestMergeAttendees' -count=1
    • make ci

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 11, 2026, 2:54 PM ET / 19:54 UTC.

  3. steipete commented on Nov 14, 2026

    @steipete
    Collaborator

    Fixed in #1336. Malformed nonblank attendees now fail before PATCH, while explicit empty or whitespace input still clears attendees.

    The regression failed against the previous main and passes with the fix. Full make ci, independent P0–P2 review, and exact-head GitHub CI passed. A built CLI also verified the outgoing request against a synthetic HTTP endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossThis issue is about lost, corrupted, or silently dropped user/session/config data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExempts this issue from stale automation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions