tycono 0.1.96-beta.56 → 0.1.96-beta.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.1.96-beta.56",
3
+ "version": "0.1.96-beta.57",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -35,19 +35,29 @@ export const SetupWizard: React.FC<SetupWizardProps> = ({ onComplete }) => {
35
35
  const [resultRoles, setResultRoles] = useState(0);
36
36
  const [errorMsg, setErrorMsg] = useState('');
37
37
 
38
- // Load team templates delay to let Ink's first render complete
39
- // Without delay, Ink's synchronous render blocks the event loop
40
- // and http response callbacks don't fire → timeout
38
+ // Load team templates with retry same-process server+client
39
+ // can have event loop contention causing ECONNRESET or timeout
41
40
  useEffect(() => {
42
- const timer = setTimeout(() => {
43
- fetchSetupTeams()
44
- .then(setTeams)
45
- .catch((err) => {
46
- setErrorMsg(`Failed to load team templates: ${err.message}`);
47
- setStep('error');
48
- });
49
- }, 500);
50
- return () => clearTimeout(timer);
41
+ let cancelled = false;
42
+ const load = async (attempt = 0): Promise<void> => {
43
+ if (cancelled) return;
44
+ // Delay to let Ink's render cycle settle
45
+ await new Promise(r => setTimeout(r, attempt === 0 ? 1000 : 2000));
46
+ if (cancelled) return;
47
+ try {
48
+ const teams = await fetchSetupTeams();
49
+ if (!cancelled) setTeams(teams);
50
+ } catch (err) {
51
+ if (cancelled) return;
52
+ if (attempt < 3) {
53
+ return load(attempt + 1);
54
+ }
55
+ setErrorMsg(`Failed to load team templates: ${err instanceof Error ? err.message : 'unknown'}`);
56
+ setStep('error');
57
+ }
58
+ };
59
+ load();
60
+ return () => { cancelled = true; };
51
61
  }, []);
52
62
 
53
63
  // Esc to cancel (only during input steps)