Skip to content
Merged
Changes from all commits
Commits
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
22 changes: 15 additions & 7 deletions model/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,25 @@ var DefaultConfig = ShellTimeConfig{
FlushCount: 10,
// 2 weeks by default
GCTime: 14,
DataMasking: nil,
DataMasking: new(true),
Endpoints: nil,
EnableMetrics: nil,
Encrypted: nil,
Encrypted: new(true),
AI: DefaultAIConfig,
Exclude: []string{},
CCUsage: nil,
CCOtel: nil, // deprecated
AICodeOtel: nil,
CodeTracking: nil,
LogCleanup: nil,
CCUsage: new(CCUsage{
Enabled: new(true),
}),
CCOtel: nil,
AICodeOtel: new(AICodeOtel{
Enabled: new(true),
GRPCPort: 54027,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The gRPC port 54027 is hardcoded here and also in model/config.go:275. To avoid magic numbers and ensure consistency, it's better to define this as a constant, for example const DefaultAICodeOtelGRPCPort = 54027 at the package level, and use it in both places.

Suggested change
GRPCPort: 54027,
GRPCPort: DefaultAICodeOtelGRPCPort,

Debug: new(false),
}),
CodeTracking: new(CodeTracking{
Enabled: new(true),
}),
Comment on lines +118 to +135
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

These changes enable several features by default in DefaultConfig, which is great for new installations. However, the way defaults are applied seems inconsistent.

In model/config.go, DataMasking is already defaulted to true if it's nil when reading a config. This ensures the feature is on for existing users who haven't configured it.

The other features enabled in this PR (Encrypted, CCUsage, AICodeOtel, CodeTracking) don't have this fallback logic in ReadConfigFile. This means they will be enabled for new users, but will remain disabled (nil) for existing users who don't have these settings in their config files.

For consistency and to provide the benefits of these features (especially security-related ones like Encrypted) to all users, consider adding similar fallback logic for these new default-enabled features in model/config.go's ReadConfigFile function, similar to how DataMasking is handled.

LogCleanup: nil,

SocketPath: DefaultSocketPath,
}