GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — fix(tui): handle race condition when agents array is empty during initialization by WhiteElephantIsNotARobot · Pull Request #11100 · anomalyco/opencode ConversationSummaryFixes TypeError: undefined is not an object (evaluating 'local.agent.current().name') This is a widespread issue (13+ duplicate issues reported) that occurs when the app starts before agents are fetched from the API. Root CauseRace condition between
Changeslocal.tsx
prompt/index.tsx
dialog-agent.tsx
Test Plan
Fixes #11096
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…tialization Fixes TypeError: undefined is not an object (evaluating 'local.agent.current().name') The issue was a race condition between SyncProvider and LocalProvider initialization: - SyncProvider starts with empty agent: [] - LocalProvider initializes immediately and tries to access agents()[0].name - agents() returns [], so agents()[0] is undefined - Accessing .name on undefined throws the TypeError Changes: 1. local.tsx: Changed agentStore.current type to string | undefined 2. local.tsx: Use optional chaining (agents()[0]?.name) for initialization 3. local.tsx: Updated current() to return undefined when no agents available 4. local.tsx: Added null checks in move(), cycle(), cycleFavorite(), set(), and createEffect 5. prompt/index.tsx: Added null check for agent.current() in submit() and createMemo functions 6. dialog-agent.tsx: Use optional chaining for agent.current()?.name This prevents the crash when the app starts before agents are fetched from the API.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. opentui: fatal: undefined is not an object (evaluating 'local.agent.current().name')Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |