Skip to content

Commit dadb7ef

Browse files
saulmcclaude
andauthored
feat(agent-builder): raise prompt-hint clamp to 350 (#1139)
Raise the client-side clamp (maxHintLength) from 240 to 350 so hints up to the new backend cap aren't truncated in the composer. Clamp test now feeds a 400-char hint and asserts 350. Claude-Session: https://claude.ai/code/session_01Jp2NeQiZiBavQCgyPZVZKd Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c5753ab commit dadb7ef

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Convos/Agent Builder/PromptHintsModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ final class PromptHintsModel {
104104
}
105105
}
106106

107-
/// Trim, drop empties, and clamp each hint to the backend's 240-char
107+
/// Trim, drop empties, and clamp each hint to the backend's 350-char
108108
/// contract so a malformed row can't blow out the composer.
109109
private static func sanitize(_ raw: [String]) -> [String] {
110110
raw
@@ -117,6 +117,6 @@ final class PromptHintsModel {
117117

118118
private enum Constant {
119119
static let maxAttempts: Int = 5
120-
static let maxHintLength: Int = 240
120+
static let maxHintLength: Int = 350
121121
}
122122
}

ConvosCore/Sources/ConvosCore/API/ConvosAPIClient+Models.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public enum ConvosAPI {
341341
}
342342

343343
/// Response envelope for `GET /v2/agent-prompt-hints` -- a flat list of
344-
/// curated prompt strings (each <= 240 chars) the agent builder's dice
344+
/// curated prompt strings (each <= 350 chars) the agent builder's dice
345345
/// control drops into the "What needs done?" composer. Public and
346346
/// unauthenticated; decoding is tolerant of extra keys via default Codable
347347
/// behavior.

ConvosTests/PromptHintsModelTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ final class PromptHintsModelTests: XCTestCase {
6565
}
6666

6767
func testSanitizeTrimsDropsEmptyAndClamps() async {
68-
let long = String(repeating: "x", count: 300)
68+
let long = String(repeating: "x", count: 400)
6969
let disk = DiskSpy(stored: [])
7070
let model = makeModel(service: MockPromptHintsService(hints: [" spaced ", "", long]), disk: disk)
7171
await model.loadOnLaunch()
7272
XCTAssertEqual(model.hints.count, 2, "Empty / whitespace-only hints are dropped")
7373
XCTAssertEqual(model.hints.first, "spaced", "Hints are trimmed")
74-
XCTAssertEqual(model.hints.last?.count, 240, "Hints are clamped to the 240-char contract")
74+
XCTAssertEqual(model.hints.last?.count, 350, "Hints are clamped to the 350-char contract")
7575
}
7676

7777
func testLoadOnLaunchRunsOnlyOnce() async {

0 commit comments

Comments
 (0)