fix: normalize env position to integer values

Agent-Logs-Url: https://github.com/whyour/qinglong/sessions/b15f49c2-c873-406f-b52b-fcdf41e2eb6c

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-17 15:22:41 +00:00 committed by GitHub
parent df677b8ad0
commit 25a8fa692a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,10 +27,10 @@ export default class EnvService {
envs.length > 0 &&
typeof envs[envs.length - 1].position === 'number'
) {
position = envs[envs.length - 1].position!;
position = this.getPrecisionPosition(envs[envs.length - 1].position!);
}
const tabs = payloads.map((x) => {
position = position - stepPosition;
position = this.getPrecisionPosition(position - stepPosition);
const tab = new Env({ ...x, position });
return tab;
});
@ -116,7 +116,7 @@ export default class EnvService {
}
private getPrecisionPosition(position: number): number {
return parseFloat(position.toPrecision(16));
return Math.trunc(parseFloat(position.toPrecision(16)));
}
public async envs(searchText: string = '', query: any = {}): Promise<Env[]> {