Skip to content

fix: restore preview image in README#57

Merged
luokerenx4 merged 8 commits intomasterfrom
dev
Mar 14, 2026
Merged

fix: restore preview image in README#57
luokerenx4 merged 8 commits intomasterfrom
dev

Conversation

@luokerenx4
Copy link
Contributor

Restores the missing preview image (docs/images/preview.png) and compresses it from 513 KB to 59 KB.

Closes #56

🤖 Generated with Claude Code

luokerenx4 and others added 8 commits March 14, 2026 16:18
ClaudeCodeProvider and AgentSdkProvider were calling
extractMediaFromToolResultContent inside onToolResult, then forwarding
the same content string via tool_result events. AgentCenter's unified
pipeline would extract again, causing persistMedia to be called twice
for the same file and duplicate image blocks in the session.

Fix: remove extraction from both providers; done.media is now always
[]. AgentCenter remains the single extraction point for tool_result
content, consistent with the "shared logic lives in AgentCenter" design.

Add A17 regression test that asserts persistMedia is called exactly
once when tool_result content contains a MEDIA marker and provider
done.media is empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ckAIProvider

GenerateProvider used a verb as identifier, making it harder to read at
a glance. Renamed to AIProvider to match the Connector pattern in
connectors/types.ts (noun-as-identity, no prefix).

Add src/ai-providers/mock.ts with MockAIProvider (analogous to
connectors/mock.ts / MockConnector): captures generateCalls and
askCalls for test assertions, configurable inputKind/providerTag/askResult.
Also exports event builder helpers (textEvent, toolUseEvent, etc.)
previously buried in __tests__/pipeline/helpers.ts.

Simplify helpers.ts to re-export MockAIProvider as FakeProvider for
backward compatibility with existing pipeline tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ai-providers/mock.ts → ai-providers/mock/index.ts
connectors/mock.ts  → connectors/mock/index.ts

Mirrors the directory-per-concern pattern used by all other modules
in these packages (vercel-ai-sdk/, claude-code/, agent-sdk/, web/,
telegram/, etc.), and gives each mock room to grow without a single
flat file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… vitest config

- Add vitest.config.ts with @/ alias (→ src/) so tests can use absolute imports
- Merge src/core/provider-utils.ts + src/ai-providers/log-tool-call.ts into
  src/ai-providers/utils.ts — all shared provider utilities now in one place
- Move provider-utils.spec.ts → ai-providers/utils.spec.ts
- Update imports in agent-center.ts and all three provider implementations
- Fix vi.mock in 5 test files: switch to @/ path + importOriginal to preserve
  real stripImageData/buildChatHistoryPrompt implementations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Matches the project's XxxManager naming convention for files that
orchestrate multiple implementations of a standard interface
(AgentCenter, ConnectorCenter, etc.) rather than being one themselves.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove CLAUDE.md from .gitignore so project context is shared across
contributors and machines. Add a note warning not to put sensitive
information in it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add and extend spec files across core and extension modules:

- core/config.spec.ts (new): loadJsonFile, parseAndSeed, writeConfigSection,
  readAIBackend/writeAIBackend, loadTradingConfig (new-format + legacy migration)
- core/compaction.spec.ts: compactIfNeeded (none/microcompact/full paths), forceCompact
- core/session.spec.ts: MemorySessionStore/SessionStore UUID chaining, readActive,
  restore(), filesystem I/O
- core/tool-center.spec.ts: getVercelTools/getMcpTools disabled-list filtering
- ai-providers/vercel-ai-sdk/vercel-provider.spec.ts (new): agent cache invalidation,
  disabledTools filtering, modelOverride bypass, generate() error path
- extension/news-collector/rss-parser.spec.ts: fetchAndParseFeed network retry paths
- extension/trading/adapter.spec.ts (new): resolveAccounts/resolveOne, searchContracts
  aggregation, getPortfolio filtering
- extension/trading/factory.spec.ts: createAlpacaFromConfig/createCcxtFromConfig
- extension/trading/providers/alpaca/AlpacaAccount.spec.ts: init retries, placeOrder,
  getPositions
- extension/trading/providers/ccxt/CcxtAccount.spec.ts (new): searchContracts sorting
  and filtering, cancelOrder cache, placeOrder notional conversion

Overall: 714 tests passing, statements 61.98% → 73.93%, branches 51.35% → 61.80%

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@luokerenx4 luokerenx4 merged commit 920d2fd into master Mar 14, 2026
2 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.

The preview image has been removed in this repo

1 participant