Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Apr 2026 19:42:32 +0000
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: b9af07d7d7bd - main - misc/claude-code: Patch claude to increase timeouts to 24 hours
Message-ID:  <69cec6a8.33c88.21552f76@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b9af07d7d7bd53f6d882ecbced4159be907265c8

commit b9af07d7d7bd53f6d882ecbced4159be907265c8
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-04-02 19:40:25 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-04-02 19:42:29 +0000

    misc/claude-code: Patch claude to increase timeouts to 24 hours
    
    Current timeouts of 1 and 10 minutes easily get exceeded when
    the AI endpoint API backend is CPU-based.
    
    Even 10x10 munutes can easily get exceeded.
    
    I raised this issue with the upstream.
    Patching it here in the meantime.
---
 misc/claude-code/Makefile | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/misc/claude-code/Makefile b/misc/claude-code/Makefile
index 827b652a5dd5..83e12ce4d0b4 100644
--- a/misc/claude-code/Makefile
+++ b/misc/claude-code/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	claude-code
 DISTVERSION=	2.1.90
+PORTREVISION=	1
 CATEGORIES=	misc # machine-learning
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -20,6 +21,8 @@ PACKAGE_NAME=	@anthropic-ai/claude-code
 
 FETCH_SCRIPT=	${PORTSDIR}/Tools/scripts/npmjs-fetch-with-dependencies.sh
 
+CLI_JS=		${WRKSRC}/node_modules/${PACKAGE_NAME}/cli.js
+
 do-fetch:
 	@if ! [ -f ${DISTDIR}/${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} ]; then \
 		${SETENV} TMPDIR=${WRKDIR} LOCALBASE=${LOCALBASE} ${FETCH_SCRIPT} \
@@ -28,6 +31,14 @@ do-fetch:
 			${DISTDIR}/${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}; \
 	fi
 
+# Raise API and MCP transport timeouts to 24 hours for slow (e.g. CPU-based) servers
+post-extract:
+	${REINPLACE_CMD} \
+		-e 's/var EP5=60000;/var EP5=86400000;/' \
+		-e 's/API_TIMEOUT_MS||String(600000)/API_TIMEOUT_MS||String(86400000)/' \
+		-e 's/DEFAULT_TIMEOUT=600000;/DEFAULT_TIMEOUT=86400000;/' \
+		${CLI_JS}
+
 do-install:
 	# install files
 	@${MKDIR} ${STAGEDIR}${PREFIX}/lib


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69cec6a8.33c88.21552f76>