Repository: TabbyML/tabby
File: clients/vscode/src/chat/webview.ts (TypeScript)

Code before:
            Promise.resolve(filterSymbols(defaultSymbols, query)),
            getWorkspaceSymbols(query),
          ]);
          this.logger.info(
            `listActiveSymbols: Found ${filteredDefault.length} filtered local symbols and ${workspaceSymbols.length} workspace symbols.`,
          );

          const mergedItems = mergeResults(
            filteredDefault.map((s) => symbolToItem(s, filepath)),
            workspaceSymbols,
            query,
            limit,
          );
          this.logger.info(`listActiveSymbols: Returning ${mergedItems.length} merged symbols.`);
          return mergedItems;
        } catch (error) {
          this.logger.error(`listActiveSymbols: Failed - ${error}`);
          return [];
        }
      },
      getChanges: async (params: GetChangesParams): Promise<ChangeItem[]> => {
        if (!this.gitProvider.isApiAvailable()) {
          return [];
        }

        const maxChars = params.maxChars || 4096;
        let remainingChars = maxChars;

        const repositories = this.gitProvider.getRepositories();
        if (!repositories) {
          return [];
        }

        const getRepoChanges = async (
          repos: Repository[],
          staged: boolean,
          charLimit: number,
        ): Promise<ChangeItem[]> => {
          if (charLimit <= 0) {
            return [];
          }

          const res: ChangeItem[] = [];
          let currentTokenCount = 0;

          for (const repo of repos) {
            const diffs = await this.gitProvider.getDiff(repo, staged);
            if (!diffs) {
              continue;
            }


Review comment (suggestion):
Please update this logic according to the API definition. 
>  ```
> /**
>   * The maximum number of characters to return in the change content.
>   * If not provided, all changes will be returned without character limitation.
>   */
> maxChars?: number

Code after:
            Promise.resolve(filterSymbols(defaultSymbols, query)),
            getWorkspaceSymbols(query),
          ]);
          this.logger.info(
            `listActiveSymbols: Found ${filteredDefault.length} filtered local symbols and ${workspaceSymbols.length} workspace symbols.`,
          );

          const mergedItems = mergeResults(
            filteredDefault.map((s) => symbolToItem(s, filepath)),
            workspaceSymbols,
            query,
            limit,
          );
          this.logger.info(`listActiveSymbols: Returning ${mergedItems.length} merged symbols.`);
          return mergedItems;
        } catch (error) {
          this.logger.error(`listActiveSymbols: Failed - ${error}`);
          return [];
        }
      },

      getChanges: async (params: GetChangesParams): Promise<ChangeItem[]> => {
        if (!this.gitProvider.isApiAvailable()) {
          return [];
        }

        const maxChars = params.maxChars ?? undefined;
        let remainingChars = maxChars;

        const repositories = this.gitProvider.getRepositories();
        if (!repositories) {
          return [];
        }

        const getRepoChanges = async (
          repos: Repository[],
          staged: boolean,
          charLimit?: number,
        ): Promise<ChangeItem[]> => {
          if (charLimit !== undefined && charLimit <= 0) {
            return [];
          }

          const res: ChangeItem[] = [];
          let currentCharCount = 0;

          for (const repo of repos) {
            const diffs = await this.gitProvider.getDiff(repo, staged);
            if (!diffs) {
              continue;
            }