Skip to content

feat: name the export path when an iWork upload is refused - #31733

Merged
bolichen97 merged 1 commit into
mainfrom
fix/26475-iwork-upload-hint
Nov 7, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/26475-iwork-upload-hint

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When a Keynote, Pages or Numbers file is refused at upload, the error tells the user how to get it in: export a PowerPoint, Word, Excel or PDF copy and upload that.

Dropping an Apple Keynote deck (.key) into the chat composer or the Files panel fails with Upload failed: Unsupported file type: .key. The same happens for .pages and .numbers. Nothing in the message says what to do next, and renaming the file does not help, because the bytes are not Office XML.

Why it matters

Keynote, Pages and Numbers are the default office apps on macOS, so their files arrive often. The way in already works (export to .pptx, .docx, .xlsx or PDF), but a user who only sees "Unsupported file type" has no reason to know that and gives up on the content.

Not a goal

  • Accepting .key, .pages or .numbers uploads. The allow-list is unchanged, so no file the parser cannot read gets in.
  • Reading iWork content (a new parser or dependency for Apple's format).
  • Changing the refusal text for any other file type.

What changed (motivation → approach → change)

The refusal for these three names was the generic one every unknown extension gets. iWork files are a closed binary format that no parser here reads, so accepting them would store a file the agent cannot open; the honest fix is a better refusal, the way HEIC photos and unplayable video containers already get one.

Both upload paths, POST /api/upload/file (chat composer) and POST /api/directory-upload (Files panel), add one sentence to the unsupported_file_type error for .key, .pages and .numbers: use File > Export To in that app to save a PowerPoint, Word, Excel or PDF copy, and upload that. The sentence opens with "If it is an Apple Keynote, Pages or Numbers document", because .key is also the usual name of a PEM key. The sentence and the three names sit beside the HEIC hint in dashboard/handlers/files.py, and both handlers in dashboard/file_api/uploads.py append it. The status, the error code and what is accepted stay the same. The dashboard spec's upload section records the hint.

Backwards compatibility

Compatible: the same names are refused with the same 400 status and unsupported_file_type code; only the error text gains a sentence after the unchanged Unsupported file type: <ext> prefix.

Removes nothing: no accepted extension, route, field or code is removed.

Tests

  • test/test_handlers_files_upload.py::test_upload_iwork_document_names_the_export_remedy (deck.key, Essay.PAGES, budget.numbers): the composer upload answers 400 unsupported_file_type, the error keeps its Unsupported file type: <ext>. prefix and names File > Export To and the four target formats, and nothing lands on disk.
  • test/test_handlers_files_directory_upload.py::test_iwork_document_refusal_names_the_export_remedy: the same refusal and hint on the Files-panel upload, with nothing written to the target folder.

Determinism: both new tests green 20 times at -n0, 10 times at -n 4 --dist loadgroup --max-worker-restart=2 beside test_handlers_files_video_upload.py and test_handlers_files_upload.py, and all 118 tests of the two touched files green in a shuffled order (seed 29060).

Manual verification

N/A — unit coverage sufficient: the change is one sentence appended to an existing error string, and both handlers are exercised end to end through aiohttp's test client.

Screenshots / video

N/A — no frontend file changes. The composer and the Files panel already show the server's error text as they do today; only that text is longer.

Related Issues

Closes #26475

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 19:47
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 19:47
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 20:13
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision b135253beb3070a455946a41ca8711a4883224ba touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of b135253beb3070a455946a41ca8711a4883224ba — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the server already refuses these files, and this only adds a sentence to that error. The allow-list, status and code stay the same.

[DESIGN-REVIEWED] b135253

Description read

[DESCRIPTION-READ] 32ae77c1a31b95b964fb58b867dc5fcd4a525b32486635bb283c8fdb4a76792a

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of b135253beb3070a455946a41ca8711a4883224ba — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: both refusal sites get the hint, and the accept list and error code stay the same.

What this change ships

Inventory (3 items) — 3 justified

Intent: a user whose Keynote, Pages or Numbers file is refused learns to export an Office or PDF copy and upload that. This is an ADDITION (#26475).

  1. A chat-composer upload of .key, .pages or .numbers is still refused, and the error now names File > Export To and the four formats that do upload — justified
  2. The same sentence is added to the refusal from the Files-panel directory upload — justified
  3. The dashboard spec's upload section records the hint — justified

[FIRST-PRINCIPLES-REVIEWED] b135253

Description read

[DESCRIPTION-READ] 586b14ebf2d557744efa436684142427d9f5d29b5056c7f5fd1c934dd35e7fa2

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed b135253beb3070a455946a41ca8711a4883224ba — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b135253

Verdict parsed from the review's SHA-scoped output markers for commit b135253beb3070a455946a41ca8711a4883224ba.

False positive or not applicable? A repository writer can comment:
/ai-review override fable b135253beb3070a455946a41ca8711a4883224ba false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of b135253beb3070a455946a41ca8711a4883224ba and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b135253

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b135253beb3070a455946a41ca8711a4883224ba false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/26475-iwork-upload-hint branch from f514943 to 4eb0493 Compare November 7, 2026 01:37
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md since this head's CI ran (8dbdf04 -> 678769e); CI re-running.

The previous head's red shards (test_pull_request_target_allowlist, test_security_gate_liveness line budget) and the Coverage Gate that follows them were red on main at the old base and are fixed on main by #31803 and #31625. The patch itself is unchanged.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/26475-iwork-upload-hint branch from 4eb0493 to 0c882e8 Compare November 7, 2026 04:55
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md since this head went green (678769e -> e4611c5); CI re-running.

The patch is unchanged. The previous head's only red was the GPT 6.1 lane, which computed a verdict but could not publish it (the API rate limit hit its comment lookup), so the new head's run replaces it.

[operator: bolichen97]

@bolichen97
bolichen97 force-pushed the fix/26475-iwork-upload-hint branch from 0c882e8 to b5bbb9d Compare November 7, 2026 07:53
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md, src/kiro_crew/dashboard/handlers/files.py since this head went green (e4611c5 -> 5f7f8d1); CI re-running.

The patch is unchanged. The previous head's red lanes (AI reviews, dependency license, sensitive change, readiness) all stopped on the installation API rate limit before reaching a verdict, so the new head's run replaces them.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The only test red on this head is test/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget (Backend Tests shard 2 on Linux, Windows and macOS, and the Coverage Gate that follows them). It fails the same way on main since be8f59b (the package is 34,855 lines against a 34,845 budget), and this PR does not touch that package. #32183 fixes it on main, so this PR waits for that to merge and then re-syncs.

The AI review lanes, the Dependency License Gate and the Sensitive Change Review on this head stopped on GitHub's installation API rate limit before giving a verdict. They will run again on that next push.

@bolichen97

bolichen97 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Withdrawn: this budget reset was posted too early. The re-sync budget on this PR stays spent until a maintainer decides on it.

Uploading an Apple Keynote, Pages or Numbers file to the chat composer
or the Files panel failed with a bare "Unsupported file type: .key".
That format is a closed binary one nothing here can read, so the
refusal stays, but the error now tells the user to use File > Export
To in that app and upload the PowerPoint, Word, Excel or PDF copy,
which the dashboard already accepts. The allow-list is unchanged.

Closes #26475
@bolichen97
bolichen97 force-pushed the fix/26475-iwork-upload-hint branch from b5bbb9d to b135253 Compare November 7, 2026 17:00
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto main 759bb96 to clear a red from the older base, not for drift: the previous head's only test red was test/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget (Backend Tests shard 2 on Linux, Windows and macOS, plus the Coverage Gate after it). That test passes on this base, and the patch is unchanged (same 54 added lines in the same 5 files). New head: b135253. Local GPT and Opus reviews of this head found nothing.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026
@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The one red on head b135253 is macOS Tests / Backend Tests (macOS) (6): test/test_cloud_ssm_cov80.py::TestInstallCommandHint::test_deb_one_liner_reaches_sudo_only_on_a_matching_download[True] fails with usage: sha256sum [-bctwz] [files ...]. That test came to main with #32380 and runs the install one-liner's sha256sum -c on the macOS runner, whose sha256sum rejects it. The same node is red on other branches' macOS shard 6 since then (for example run 42394214741), and this PR touches nothing under cloud/. It is a main-side macOS break, not this change; the patch here is unchanged.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved: PR Readiness passed on b135253, and all five review lanes (Opus 5.5, GPT 6.1, Design, UX, First Principles) report no blocking finding on this head. No conflict and no open change request.

@bolichen97
bolichen97 merged commit 6fd0242 into main Nov 7, 2026
105 of 106 checks passed
@bolichen97
bolichen97 deleted the fix/26475-iwork-upload-hint branch November 7, 2026 19:47
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
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.

Chat/Files upload rejects Apple Keynote (.key) — a proprietary IWA/Protobuf container, not an OOXML allow-list fix like #26228

2 participants