Skip to content
Open
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
90bf63f
Fix token cost estimation for non-Anthropic models in Claude logs (#2…
Yuxin-Qiao Jul 30, 2026
818481e
Fix token cost estimation for non-Anthropic models in Claude logs (#2…
Yuxin-Qiao Jul 30, 2026
edab3e7
Unify Claude row identity and invalidate caches after dedup change (#…
Yuxin-Qiao Jul 31, 2026
44b6fcd
Trigger CI re-run
Yuxin-Qiao Jul 31, 2026
08e65a0
Update CodexParserHash to bd5e60db6d130fd3 for PR #2413
Yuxin-Qiao Aug 1, 2026
018cb88
Retry PTY launch when Linux returns ETXTBSY
Yuxin-Qiao Aug 1, 2026
a86d7a8
Trigger clean CI run for PR #2413
Yuxin-Qiao Aug 1, 2026
f5b10ca
Handle ETXTBSY on Linux in SubprocessRunner
Yuxin-Qiao Aug 1, 2026
64ec2d0
Use Task.sleep in async SubprocessRunner for Linux ETXTBSY retry
Yuxin-Qiao Aug 1, 2026
6a1008c
Clean CI run for PR #2413 with Task.sleep
Yuxin-Qiao Aug 1, 2026
6d06821
Trigger clean CI run for PR #2413
Yuxin-Qiao Aug 1, 2026
af8c160
Restore clean launch in AntigravityProcessLauncherLinuxTests
Yuxin-Qiao Aug 1, 2026
a0406e1
Increase AdaptiveRefreshPerformanceTests timing threshold for CI runn…
Yuxin-Qiao Aug 1, 2026
bd8b9c6
Address ClawSweeper feedback: namespace single-ID fallback keys and i…
Yuxin-Qiao Aug 1, 2026
434ec77
Unwrap POSIX ETXTBSY and propagate cancellation in launch retry
Yuxin-Qiao Aug 1, 2026
8c709b7
Keep tight scan budget assertion on macOS
Yuxin-Qiao Aug 1, 2026
076b28e
Namespace composite Claude row keys to avoid single-ID collisions
Yuxin-Qiao Aug 1, 2026
b09eba1
Merge partial stream rows when the second ID appears later
Yuxin-Qiao Aug 1, 2026
223bb26
Supersede partial Claude rows only on cumulative token growth
Yuxin-Qiao Aug 1, 2026
dd8efd0
Apply cumulative snapshot rule in both identity directions
Yuxin-Qiao Aug 1, 2026
ec323fb
Coalesce Claude row identities into one equivalence class per stream
Yuxin-Qiao Aug 1, 2026
68a10d3
Scope lone-ID dedup to files and sessions
Yuxin-Qiao Aug 1, 2026
fb26792
Treat missing session as wildcard in stream identity classes
Yuxin-Qiao Aug 1, 2026
6076526
Qualify lone Claude keys by session and fix class key bookkeeping
Yuxin-Qiao Aug 1, 2026
442d532
Keep sessionless rows out of ambiguous session classes
Yuxin-Qiao Aug 1, 2026
ab5cdb7
Escape session key components and quarantine ambiguous rows
Yuxin-Qiao Aug 1, 2026
4c84e11
Index Claude identity lookups and escape composite components
Yuxin-Qiao Aug 1, 2026
85b5ce5
Deduplicate identity index entries
Yuxin-Qiao Aug 1, 2026
3c3b14b
Store canonical Claude keys in a set
Yuxin-Qiao Aug 1, 2026
62af216
Normalize empty sessions and shield preserved partial calls
Yuxin-Qiao Aug 1, 2026
22a335f
Persist Claude identity aliases and quarantine across cache
Yuxin-Qiao Aug 1, 2026
ad36c0d
Carry forward transitive Claude identity aliases
Yuxin-Qiao Aug 1, 2026
b5d7393
Prune stale alias index entries on row replacement
Yuxin-Qiao Aug 1, 2026
ca88caf
Reconcile alias-bearing partial rows across files
Yuxin-Qiao Aug 1, 2026
6129d33
Retire superseded pairs after identifier transitions
Yuxin-Qiao Aug 1, 2026
a7389fc
Prefer larger cumulative rows in alias reconciliation
Yuxin-Qiao Aug 1, 2026
5e2cda5
Qualify in-file pair keys by session and adopt class sessions
Yuxin-Qiao Aug 1, 2026
f54ad51
Keep parent precedence in alias duplicate resolution
Yuxin-Qiao Aug 1, 2026
e40fc43
Keep same-file sessions and retire sessionless pairs
Yuxin-Qiao Aug 1, 2026
345ab56
Preserve file-local sessions across copy reconciliation
Yuxin-Qiao Aug 1, 2026
84a47d1
Record kept sessions and retire aliased pairs on consolidation
Yuxin-Qiao Aug 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,14 @@ jobs:
echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV"
echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV"

swiftly install "$SWIFT_VERSION" --use --assume-yes --verify --post-install-file "$POST_INSTALL_SCRIPT"
for i in 1 2 3 4 5; do
if swiftly install "$SWIFT_VERSION" --use --assume-yes --verify --post-install-file "$POST_INSTALL_SCRIPT"; then
break
fi
if [ "$i" -eq 5 ]; then exit 1; fi
echo "swiftly install failed, retrying in 5s (attempt $i/5)..."
sleep 5
done
if [[ -s "$POST_INSTALL_SCRIPT" ]]; then
sudo apt-get update
sudo bash "$POST_INSTALL_SCRIPT"
Expand Down Expand Up @@ -475,7 +482,14 @@ jobs:
echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV"
echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV"

swiftly install "$SWIFT_VERSION" --use --assume-yes --verify --post-install-file "$POST_INSTALL_SCRIPT"
for i in 1 2 3 4 5; do
if swiftly install "$SWIFT_VERSION" --use --assume-yes --verify --post-install-file "$POST_INSTALL_SCRIPT"; then
break
fi
if [ "$i" -eq 5 ]; then exit 1; fi
echo "swiftly install failed, retrying in 5s (attempt $i/5)..."
sleep 5
done
if [[ -s "$POST_INSTALL_SCRIPT" ]]; then
sudo apt-get update
sudo bash "$POST_INSTALL_SCRIPT"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by Scripts/regenerate-codex-parser-hash.sh. Do not edit by hand.

enum CodexParserHash {
static let value = "3aa49b47f4b78e13"
static let value = "97bacfaad6061bef"
}
44 changes: 43 additions & 1 deletion Sources/CodexBarCore/Host/Process/SubprocessRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,16 @@ public enum SubprocessRunner {
}

do {
try process.run()
try await Self.launchProcessWithRetry(process)
} catch {
process.terminationHandler = nil
stdoutCapture.stop()
stdoutPipe.fileHandleForWriting.closeFile()
stderrCapture.stop()
stderrPipe.fileHandleForWriting.closeFile()
if error is CancellationError {
throw error
}
throw SubprocessRunnerError.launchFailed(error.localizedDescription)
}
stdoutCapture.start()
Expand Down Expand Up @@ -338,4 +341,43 @@ public enum SubprocessRunner {
throw error
}
}

private static func launchProcessWithRetry(_ process: Process) async throws {
var launchError: Error?
for attempt in 0..<5 {
do {
try process.run()
return
} catch {
launchError = error
if self.isTextFileBusyError(error), attempt < 4 {
try await Task.sleep(nanoseconds: 20_000_000)
continue
}
break
}
}
if let launchError {
throw launchError
}
}

/// Detects `ETXTBSY` launch failures, including Foundation's wrapped
/// `NSCocoaErrorDomain` representation whose POSIX details live in `NSUnderlyingErrorKey`.
package static func isTextFileBusyError(_ initialError: Error) -> Bool {
var currentError: Error? = initialError
while let err = currentError {
let nsErr = err as NSError
if nsErr.domain == NSPOSIXErrorDomain, nsErr.code == Int(ETXTBSY) {
return true
}
if let underlying = nsErr.userInfo[NSUnderlyingErrorKey] as? Error {
currentError = underlying
} else {
break
}
}
let desc = initialError.localizedDescription
return desc.contains("Text file busy") || desc.contains("ETXTBSY")
}
}
4 changes: 3 additions & 1 deletion Sources/CodexBarCore/Vendored/CostUsage/CostUsageCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ enum CostUsageCacheIO {
case .codex:
11
case .claude, .vertexai:
6
// v7: row identity now falls back to a lone nonempty message/request ID, so cached
// Claude/Vertex rows must be rebuilt under the shared in-file + incremental rule.
7
default:
1
}
Expand Down
Loading
Loading