Skip to content

[pull] main from danny-avila:main - #159

Merged
pull[bot] merged 2 commits into
innFactory:mainfrom
danny-avila:main
Aug 4, 2026
Merged

[pull] main from danny-avila:main#159
pull[bot] merged 2 commits into
innFactory:mainfrom
danny-avila:main

Conversation

@pull

@pull pull Bot commented Aug 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

danny-avila and others added 2 commits August 4, 2026 07:30
…#382)

CODE_ARTIFACT_PATH_GUIDANCE buried the multi-call persistence rule in a
trailing clause, listed only ten data-format extensions, and called
everything else "odd extensions". Models kept writing helper files to
/tmp and reading them a call later despite the docs (observed in
production), and the narrow list wrongly implied source files such as
.py helper modules do not persist, when the code API's output filter
accepts all common source, text, data, document, image, and archive
formats.

The guidance now leads with the imperative rule (write anything a later
call needs under /mnt/data in the same call that produces it), gives
representative extension examples grounded in the actual filter, and
defines the unrecognized-extension behavior explicitly.
…xtraction (#380)

getCacheWriteTokens/attachCacheWriteMetadata read
usage.input_tokens_details.cache_write_tokens with only the first `?.`
optional — safe against OpenAI itself (which always populates
input_tokens_details), but any OpenAI-*compatible* server that omits it
(e.g. mlx_vlm.server and other local/self-hosted backends) threw
"Cannot read properties of undefined (reading 'cache_write_tokens')"
on every single completion.

ResponsesUsageWithCacheWrite's plain intersection with the SDK's
ResponseUsage type was part of why this slipped past review: the SDK
declares input_tokens_details required, so the intersection kept it
required despite the local `?:` redeclaration, which is also why a
bare `?.` add-on trips
@typescript-eslint/no-unnecessary-condition. Switched to the same
Omit-then-redeclare pattern this file already uses for
CompletionUsageWithCacheWrite (the analogous Completions API field),
so the type honestly reflects that this field is genuinely optional
for non-OpenAI backends.

Exported the three helpers (previously module-private) for direct
unit test coverage; added cacheWriteTokens.test.ts covering the
missing-field, missing-usage, and field-present cases for all three.
@pull pull Bot locked and limited conversation to collaborators Aug 4, 2026
@pull pull Bot added the ⤵️ pull label Aug 4, 2026
@pull
pull Bot merged commit db62a40 into innFactory:main Aug 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants