Skip to content

fix: include original file name in compact message output#64

Merged
AmethystLiang merged 3 commits intostablyai:mainfrom
jprichardson:fix/include-file-name-in-compact-output
Mar 22, 2026
Merged

fix: include original file name in compact message output#64
AmethystLiang merged 3 commits intostablyai:mainfrom
jprichardson:fix/include-file-name-in-compact-output

Conversation

@jprichardson
Copy link
Contributor

@jprichardson jprichardson commented Mar 12, 2026

Summary

  • CompactSlackMessage.files only included mimetype, mode, and path — the human-readable filename from Slack was dropped during compaction
  • Files were saved and referenced by Slack file ID (e.g. F08ABCD1234.pdf) instead of the original name (e.g. Q4 Report.pdf)
  • Added name field to the compact file output, sourced from SlackFileSummary.name

Before:

{ "mimetype": "application/pdf", "mode": "hosted", "path": "/tmp/downloads/F08ABCD1234.pdf" }

After:

{ "name": "Q4 Report.pdf", "mimetype": "application/pdf", "mode": "hosted", "path": "/tmp/downloads/F08ABCD1234.pdf" }

Changes

  • name maps to f.name only (not f.title) — keeps the field narrowly defined as the actual filename
  • Added test/message-compact.test.ts with 3 test cases for serialized output
  • Documented file fields in skills/agent-slack/references/output.md

Test plan

  • bun test — 129 tests pass (includes new message-compact tests)
  • bun run lint — clean
  • bun run format:check — clean
  • Verified with bun run dev -- message get <url> that name field appears with the original Slack filename

🤖 Generated with Claude Code

@jprichardson jprichardson force-pushed the fix/include-file-name-in-compact-output branch from 84e697e to 08980f5 Compare March 12, 2026 21:18
@AmethystLiang
Copy link
Contributor

This is a nice improvement. Adding a human-meaningful file label next to files[].path will make the output much easier for agents to use.

One small request before merging: could we make files[].name map to f.name only, instead of f.name || f.title? f.name is usually the actual filename, while title is more of a display label in Slack, so keeping name narrowly defined will make the JSON more predictable for downstream agents.

Could you also add a small test for the serialized output and update the README / skill docs to mention the new field? Since this changes the public JSON shape, it would be good to land the behavior, tests, and docs together.

If you make those changes, I’m happy to land this.

jprichardson added a commit to jprichardson/agent-slack that referenced this pull request Mar 21, 2026
Address reviewer feedback on stablyai#64:
- Map name to f.name only, not f.name || f.title
- Add test/message-compact.test.ts covering serialized output
- Document file fields in skills/agent-slack/references/output.md

Co-Authored-By: Claude <noreply@anthropic.com>
@jprichardson jprichardson force-pushed the fix/include-file-name-in-compact-output branch from 08980f5 to c25d98b Compare March 21, 2026 22:28
@jprichardson
Copy link
Contributor Author

Thanks for the review! Addressed all three points:

  1. name narrowed — now maps to f.name only (not f.name || f.title)
  2. Test addedtest/message-compact.test.ts with 3 cases: name present, name missing (no title fallback), and files without download paths
  3. Docs updated — added "File fields in compact messages" section to skills/agent-slack/references/output.md

Also rebased onto current main (v0.6.0).

@jprichardson jprichardson force-pushed the fix/include-file-name-in-compact-output branch from c25d98b to f810bc6 Compare March 21, 2026 22:32
- Add `name` field to `CompactSlackMessage.files`, sourced from `f.name`
- Add test/message-compact.test.ts with 3 test cases
- Document file fields in skills/agent-slack/references/output.md

Co-Authored-By: Claude <noreply@anthropic.com>
@jprichardson jprichardson force-pushed the fix/include-file-name-in-compact-output branch from f810bc6 to 592d5b5 Compare March 21, 2026 22:38
Copy link
Contributor

@AmethystLiang AmethystLiang left a comment

Choose a reason for hiding this comment

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

Reviewed the follow-up. README and skill docs now match the new files[].name output, and the new test helper typechecks.

@AmethystLiang AmethystLiang merged commit 30e91e4 into stablyai:main Mar 22, 2026
1 check 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.

2 participants