Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

Add hash parameter to auth hooks for tracking client config state

Dane Schneider57170a2c02f3
diff --git a/app/server/handlers/auth_helpers.go b/app/server/handlers/auth_helpers.go
index 7f14c8ea..9d8a938e 100644
--- a/app/server/handlers/auth_helpers.go
+++ b/app/server/handlers/auth_helpers.go
@@ -567,10 +567,17 @@ func execAuthenticate(w http.ResponseWriter, r *http.Request, requireOrg bool, r
Permissions: permissionsMap,
}
+ // don't send hash for org-session requests
+ var hash string
+ if r.URL.Path != "/orgs/session" {
+ hash = parsed.Hash
+ }
+
_, apiErr := hooks.ExecHook(hooks.Authenticate, hooks.HookParams{
Auth: auth,
AuthenticateHookRequestParams: &hooks.AuthenticateHookRequestParams{
Path: r.URL.Path,
+ Hash: hash,
},
})
diff --git a/app/server/hooks/hooks.go b/app/server/hooks/hooks.go
index 96248960..08380e1a 100644
--- a/app/server/hooks/hooks.go
+++ b/app/server/hooks/hooks.go
@@ -33,6 +33,7 @@ type WillSendModelRequestParams struct {
InputTokens int
OutputTokens int
ModelName shared.ModelName
+ IsUserPrompt bool
}
type DidSendModelRequestParams struct {
@@ -119,6 +120,7 @@ type CreateOrgHookRequestParams struct {
type AuthenticateHookRequestParams struct {
Path string
+ Hash string
}
type FastApplyParams struct {