Repository navigation
feat: align Qoder client fingerprint and WorkBuddy client versions - #349
Merged
Merged
Conversation
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Client fingerprint + version alignment for Qoder and WorkBuddy. Kept separate from
feat/upstream-align; edits in shared files (qauth.go,credential.go) are minimal (constant/header lines only). New logic lives inqauth/fingerprint.go.Qoder (ref qoder2api-hub fe62bf6, 513254d, 76716dc)
qauth.CosyVersion(1.1.32).qoder.COSYVersion, the OpenAPI UA version, the bearer payloadcosyVersionand bothcosy-versionheaders now use it. The stale0.1.43is gone.Go-http-client/2.0. UA comes fromqauth.UserAgent(region):QoderWork/<v>for CN,Qoder/<v>for international. The edition is inferred from the request host (*.qoder.sh= international).Session.Signpath, plusqauth.OpenStreamLines) now sendcosy-machineos: x86_64_linuxandcosy-machinehostname: DESKTOP-XXXXXXX. The hostname is md5(hostname:+uid), so it is stable for one account and different across accounts. Non-SSE calls do not send them.qodercli vs desktop: what we emulate and why
session_type: "qodercli",product: "cli",cosy-clienttype: 5,COSYVersion"matches the pinned worker CLI", and the CN runtime path is@qodercn-ai/qoderclicnqoderclicn.js. So the version stays on the CLI line (1.1.32), not desktop 1.1.64 as upstream fe62bf6 uses.npm view @qoder-ai/qoderclishows the bin isbundle/qodercli.js(a Node bundle, 1.1.76). A Node client never sendsGo-http-client/2.0, so that UA is a gateway fingerprint either way.Cosy-MachineOS(${arch}_${platform}) on all identity headers. It setsCosy-MachineHostname(os.hostname) only forrequestClass === "infer-sse". That matches 76716dc, and we mirror it.QoderWork/Qoder) and pair them with our single CLI version. The exact UA that qodercli's fetch emits could not be confirmed statically. If live A/B shows a different string, change it only inqauth/fingerprint.go.WorkBuddy (ref workbuddy2api-hub 4ed27f1)
credential.go: CLI 2.161.0, desktop intl 5.8.4, desktop CN 5.8.3, IDE 2.168.2, all in one place.WorkBuddy/5.8.4 workbuddy-ai/5.8.4 CLI/2.161.0(intl) andWorkBuddy/5.8.3 WorkBuddy/5.8.3 CLI/2.161.0(CN, same middle token as upstream's CN form). AddedDesktopUserAgentFor(global).DesktopUserAgentstays an alias of the intl UA, soheaders.gois untouched and nothing conflicts with #upstream-align.headers.go).IDEVersionis defined but has no request path in cli2api that uses it yet.Tests
qauth/fingerprint_test.go: UA split, hostname stability, payload version, and the JSON-vs-SSE header sets via httptest.fingerprint_test.go: the directSession.Signcarries the UA, version, OS and hostname for both regions.workbuddy/versions_test.go: versions and both desktop UAs. Updated the CLI version assertion inclient_test.go.go test ./...passes;scripts/release-notes.py validatepasses.