fix: restore interactive OpenAI REPL on React 18

This commit is contained in:
Kevin
2026-04-01 09:47:21 +08:00
parent e69cf0917e
commit 770e16dadb
7 changed files with 92 additions and 155 deletions

View File

@@ -596,7 +596,6 @@ export function REPL({
sshSession,
thinkingConfig
}: Props): React.ReactNode {
logForDebugging('[REPL:render] function entry');
const isRemoteSession = !!remoteSessionConfig;
// Env-var gates hoisted to mount-time — isEnvTruthy does toLowerCase+trim+
@@ -608,12 +607,6 @@ export function REPL({
// biome-ignore lint/correctness/useHookAtTopLevel: feature() is a compile-time constant
useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_MESSAGE_ACTIONS), []) : false;
// Log REPL mount/unmount lifecycle
useEffect(() => {
logForDebugging(`[REPL:mount] REPL mounted, disabled=${disabled}`);
return () => logForDebugging(`[REPL:unmount] REPL unmounting`);
}, [disabled]);
// Agent definition is state so /resume can update it mid-session
const [mainThreadAgentDefinition, setMainThreadAgentDefinition] = useState(initialMainThreadAgentDefinition);
const toolPermissionContext = useAppState(s => s.toolPermissionContext);