-
Notifications
You must be signed in to change notification settings - Fork 82
Change context size and reasoning budget types from int64/uint64 to int32 #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,9 +284,9 @@ func packageModel(cmd *cobra.Command, opts packageOptions) error { | |
| distClient := initResult.distClient | ||
|
|
||
| // Set context size | ||
| if opts.contextSize > 0 { | ||
| if cmd.Flags().Changed("context-size") { | ||
| cmd.PrintErrf("Setting context size %d\n", opts.contextSize) | ||
| pkg = pkg.WithContextSize(opts.contextSize) | ||
| pkg = pkg.WithContextSize(int32(opts.contextSize)) | ||
| } | ||
|
Comment on lines
+287
to
290
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The conversion from if cmd.Flags().Changed("context-size") {
if opts.contextSize > 2147483647 { // math.MaxInt32
return fmt.Errorf("context size %d is too large, must be less than or equal to 2147483647", opts.contextSize)
}
cmd.PrintErrf("Setting context size %d\n", opts.contextSize)
pkg = pkg.WithContextSize(int32(opts.contextSize))
} |
||
|
|
||
| // Add license files | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -321,7 +321,7 @@ func cmdPackage(args []string) int { | |
|
|
||
| if contextSize > 0 { | ||
| fmt.Println("Setting context size:", contextSize) | ||
| b = b.WithContextSize(contextSize) | ||
| b = b.WithContextSize(int32(contextSize)) | ||
| } | ||
|
Comment on lines
322
to
325
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to another file, the conversion from if contextSize > 0 {
if contextSize > 2147483647 { // math.MaxInt32
fmt.Fprintf(os.Stderr, "context size %d is too large, must be less than or equal to 2147483647\n", contextSize)
return 1
}
fmt.Println("Setting context size:", contextSize)
b = b.WithContextSize(int32(contextSize))
} |
||
|
|
||
| if mmproj != "" { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (testing): Add an integration test path where contextSize is nil to ensure default behavior is preserved
Right now all integration call sites pass a non‑nil
*int32tocreateAndPushTestModel, so thenilpath isn’t exercised. Please add a test that usescontextSize == niland confirms the model can still be pushed/pulled/inspected and that no unexpected context-size metadata is introduced, preserving the previous default behavior after the switch to*int32.