Skip to content

identity: save binary responses to workspace - #77

Merged
antra-tess merged 1 commit into
mainfrom
mica/identity-request-binary
Aug 5, 2026
Merged

identity: save binary responses to workspace#77
antra-tess merged 1 commit into
mainfrom
mica/identity-request-binary

Conversation

@antra-tess

Copy link
Copy Markdown
Contributor

Problem

identity--request always called Response.text(). Binary service assets therefore entered model context as corrupt UTF-8 and were truncated before an agent could save or inspect them.

Change

  • Read response bytes once and classify from content type, with no-header JSON compatibility.
  • Binary without saveAs: return only {size, contentType, sha256} and a safe instruction.
  • Optional saveAs writes exact bytes through WorkspaceModule.writeBinary, preserving Chronicle/materialization behavior, and returns path + hash.
  • Preserve existing JSON/text behavior and 24 KiB inline truncation.
  • Bound fetched bodies at 64 MiB.

Evidence

  • Added a byte-exact PNG test including invalid UTF-8 bytes.
  • bun test test/identity-and-surfaces.test.ts: 8/8 pass.
  • bunx tsc --noEmit reaches one pre-existing unrelated error in frontdesk-strategy.ts:168; no new identity errors.

This fixes the general host seam; Orrery remains unchanged.

@cursor

cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@antra-tess
antra-tess merged commit 2dc4bf6 into main Aug 5, 2026
2 of 3 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.

1 participant