Skip to content

Conversation

@bfollington
Copy link
Contributor

@bfollington bfollington commented Apr 29, 2025

CT-350 CT-351 CT-352 CT-353 CT-354

TODO

Ideas

  • default React component export (prevent onReady footgun?)
  • super hacky customisable system prompt (end user)?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses several issues outlined in CT-350 through CT-354 by updating API defaults, enhancing the useReactiveCell hook to support key paths, improving boolean tests for empty string values, and refining documentation.

  • Update of default LLM models in llm/src/types.ts
  • Refactor of useReactiveCell in bootstrap.js to accept key paths and adjustments in LLM response handling
  • Improved check for plan description in charm/src/iterate.ts and documentation updates in charm/src/iframe/static.ts

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
llm/src/types.ts Changed default iframe model from "google:gemini-2.0-flash" to "openai:gpt-4.1-nano".
jumble/public/module/charm/sandbox/bootstrap.js Refactored useReactiveCell to take key paths and updated LLM response handling in APIs.
charm/src/iterate.ts Modified condition for plan description to accept empty strings as valid input.
charm/src/iframe/static.ts Updated API documentation and examples to reflect the new useReactiveCell(keyPath: string[]).
Comments suppressed due to low confidence (1)

jumble/public/module/charm/sandbox/bootstrap.js:133

  • The removal of the '.then(result => result.content)' unwrap in generateText may result in inconsistent handling when the LLM returns a direct string and when it returns an object. Consider adding a conditional check to unwrap the .content property only when necessary.
window.generateText = function ({ system, messages }) {

window.removeEventListener("message", handleMessage);
window.parent.postMessage({ type: "unsubscribe", data: [rootKey] }, "*");
};
}, [rootKey, nestedPath.join(".")]); // Dependency on stringified path
Copy link

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

[nitpick] Using nestedPath.join(".") in the dependency array could be problematic if any key contains periods. Consider an alternative approach for dependency tracking that avoids potential collisions in key names.

Suggested change
}, [rootKey, nestedPath.join(".")]); // Dependency on stringified path
}, [rootKey, nestedPath]); // Dependency on array reference

Copilot uses AI. Check for mistakes.
@bfollington bfollington merged commit 3ee7c5f into main Apr 30, 2025
5 checks passed
@bfollington bfollington deleted the fix/charmathon-2025-05-30-fixes branch April 30, 2025 02:55
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