René's URL Explorer Experiment


Title: fix(files): read offset 0 as the first line instead of rejecting it by waleedlatif1 · Pull Request #8588 · simstudioai/sim · GitHub

Open Graph Title: fix(files): read offset 0 as the first line instead of rejecting it by waleedlatif1 · Pull Request #8588 · simstudioai/sim

X Title: fix(files): read offset 0 as the first line instead of rejecting it by waleedlatif1 · Pull Request #8588 · simstudioai/sim

Description: Summary files read --offset 0 failed with offset starts at line 1. Callers used to zero-based paging (agents in particular) send 0 for the first window, and this was the most common argument error the Chat agent hit with sim_cli, at about 30 a day. offset now accepts 0 and reads it as the first line. The response's lineRange.offset still reports 1, so the caller learns the 1-based convention from the result. A negative offset is still rejected. This applies to both contracts that take a file line window: v2 GET /files/{id}/text (and files versions read, which shares the schema), and the File block's content operation that Agent-block LLMs call. sliceFileTextLines already clamped a start below line 1, so no reader changes were needed. A new test pins that clamp, since the relaxed contract now relies on it. Regenerated the OpenAPI document, the sim CLI API, and the CLI docs: minimum goes from 1 to 0, and the description says 0 starts at the first line. Type of Change Bug fix Testing Red-first, so each new case fails on the pre-fix code: route.test.ts (v2 text): offset=0 returns 200. operations.test.ts: the File block's content op with offset: 0 returns the first line and reports lineRange.offset: 1. text-lines.test.ts: removing the clamp turns the offset-0 case red. file-read.test.ts: the engine's reject list now uses -1 instead of 0. bun run lint, bun run type-check (apps/sim), check:api-validation:strict, check:audits, docs-manifest:check, block-registry check, and root bun run test all passed. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary files read --offset 0 failed with offset starts at line 1. Callers used to zero-based paging (agents in particular) send 0 for the first window, and this was the most common argument error...

X Description: Summary files read --offset 0 failed with offset starts at line 1. Callers used to zero-based paging (agents in particular) send 0 for the first window, and this was the most common argument error...

Opengraph URL: https://github.com/simstudioai/sim/pull/8588

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:22ec4417-2d3f-ae92-2279-ac6a5ea9ab11
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC566:23725B:B4D721:F88FA6:6AFB50DA
html-safe-nonce555a1eac8d81d076ddadcea6f0cf5b250d3d1ddf958f6e3ff2e76d259213ac98
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTY2OjIzNzI1QjpCNEQ3MjE6Rjg4RkE2OjZBRkI1MERBIiwidmlzaXRvcl9pZCI6IjU1MDY1NDQ2NDU3NTA5OTA5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8db6da2f5e292ec36cd36ef301790e1ef8a0db4ae1c3cb477891e1039a5c3b93
hovercard-subject-tagpull_request:4721873639
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/8588/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary files read --offset 0 failed with offset starts at line 1. Callers used to zero-based paging (agents in particular) send 0 for the first window, and this was the most common argument error...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8588/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8588%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8588%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/8588/files
Reloadhttps://github.com/simstudioai/sim/pull/8588/files
Reloadhttps://github.com/simstudioai/sim/pull/8588/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/chat-tool-ergonomicshttps://github.com/simstudioai/sim/tree/fix/chat-tool-ergonomics
Conversation 13 https://github.com/simstudioai/sim/pull/8588
Commits 2 https://github.com/simstudioai/sim/pull/8588/commits
Checks 32 https://github.com/simstudioai/sim/pull/8588/checks
Files changed https://github.com/simstudioai/sim/pull/8588/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8588/files
fix(files): read offset 0 as the first line instead of rejecting it https://github.com/simstudioai/sim/pull/8588/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/8588/files
ea8761a fix(files): read offset 0 as the first line instead of rejecting it waleedlatif1 Oct 2, 2026 https://github.com/simstudioai/sim/pull/8588/commits/ea8761aaf29521dc506245424be374858848a890
ef6bb7b test(files): cover the agent CLI forwarding --offset 0 waleedlatif1 Oct 2, 2026 https://github.com/simstudioai/sim/pull/8588/commits/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6
Clear filters https://github.com/simstudioai/sim/pull/8588/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8588/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8588/files
files.mdx https://github.com/simstudioai/sim/pull/8588/files#diff-dd195861b84c810d004b7ff3182f486abc58890bfa9792ce2acb9bb6427bfefc
reference.mdx https://github.com/simstudioai/sim/pull/8588/files#diff-2ef1dc35e44a2520b34fb146c4103e9d7cf235e4e4937315a5b40a7db6338406
openapi-v2-files-audit.json https://github.com/simstudioai/sim/pull/8588/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
route.test.ts https://github.com/simstudioai/sim/pull/8588/files#diff-46d403b4dc6a72591726fe02e7cd443a15f3afffb795377829b1bcce8dc80bd2
file.ts https://github.com/simstudioai/sim/pull/8588/files#diff-ec1001c1d9c13d466d00f98de32771c5591193b97771342a1254a5a203257047
files.ts https://github.com/simstudioai/sim/pull/8588/files#diff-615f44153f90418dc013f064e82e3f80f38bee63452ab7612e669651365c90b9
operations.test.ts https://github.com/simstudioai/sim/pull/8588/files#diff-5b618a3954aee1f8dad948808cf9107f1f42b6a08bcc904adb65d83c19cce192
file-read.test.ts https://github.com/simstudioai/sim/pull/8588/files#diff-cd25374b25d55ddbf435f37752ac4d11821e18cd801d750c5ad43f13b9bb049d
text-lines.test.ts https://github.com/simstudioai/sim/pull/8588/files#diff-e31ff9bf57fcaac084d6f051106e6c2495fe34a9a666daa552cd3e90044110a0
v2-api.ts https://github.com/simstudioai/sim/pull/8588/files#diff-e856e756b18965607efb943e85bad153871936ce3ee5180ec2e8073a28dd1dd7
apps/docs/content/docs/cli/files.mdxhttps://github.com/simstudioai/sim/pull/8588/files#diff-dd195861b84c810d004b7ff3182f486abc58890bfa9792ce2acb9bb6427bfefc
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/docs/content/docs/cli/files.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-dd195861b84c810d004b7ff3182f486abc58890bfa9792ce2acb9bb6427bfefc
https://github.com/simstudioai/sim/pull/8588/files#diff-dd195861b84c810d004b7ff3182f486abc58890bfa9792ce2acb9bb6427bfefc
https://github.com/simstudioai/sim/pull/8588/files#diff-dd195861b84c810d004b7ff3182f486abc58890bfa9792ce2acb9bb6427bfefc
https://github.com/simstudioai/sim/pull/8588/files#diff-dd195861b84c810d004b7ff3182f486abc58890bfa9792ce2acb9bb6427bfefc
apps/docs/content/docs/cli/reference.mdxhttps://github.com/simstudioai/sim/pull/8588/files#diff-2ef1dc35e44a2520b34fb146c4103e9d7cf235e4e4937315a5b40a7db6338406
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/docs/content/docs/cli/reference.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-2ef1dc35e44a2520b34fb146c4103e9d7cf235e4e4937315a5b40a7db6338406
https://github.com/simstudioai/sim/pull/8588/files#diff-2ef1dc35e44a2520b34fb146c4103e9d7cf235e4e4937315a5b40a7db6338406
https://github.com/simstudioai/sim/pull/8588/files#diff-2ef1dc35e44a2520b34fb146c4103e9d7cf235e4e4937315a5b40a7db6338406
https://github.com/simstudioai/sim/pull/8588/files#diff-2ef1dc35e44a2520b34fb146c4103e9d7cf235e4e4937315a5b40a7db6338406
apps/docs/openapi-v2-files-audit.jsonhttps://github.com/simstudioai/sim/pull/8588/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/docs/openapi-v2-files-audit.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
https://github.com/simstudioai/sim/pull/8588/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
https://github.com/simstudioai/sim/pull/8588/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
https://github.com/simstudioai/sim/pull/8588/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
apps/sim/app/api/v2/files/[fileId]/text/route.test.tshttps://github.com/simstudioai/sim/pull/8588/files#diff-46d403b4dc6a72591726fe02e7cd443a15f3afffb795377829b1bcce8dc80bd2
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/sim/app/api/v2/files/%5BfileId%5D/text/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-46d403b4dc6a72591726fe02e7cd443a15f3afffb795377829b1bcce8dc80bd2
https://github.com/simstudioai/sim/pull/8588/files#diff-46d403b4dc6a72591726fe02e7cd443a15f3afffb795377829b1bcce8dc80bd2
apps/sim/lib/api/contracts/tools/file.tshttps://github.com/simstudioai/sim/pull/8588/files#diff-ec1001c1d9c13d466d00f98de32771c5591193b97771342a1254a5a203257047
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/sim/lib/api/contracts/tools/file.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-ec1001c1d9c13d466d00f98de32771c5591193b97771342a1254a5a203257047
https://github.com/simstudioai/sim/pull/8588/files#diff-ec1001c1d9c13d466d00f98de32771c5591193b97771342a1254a5a203257047
apps/sim/lib/api/contracts/v2/files.tshttps://github.com/simstudioai/sim/pull/8588/files#diff-615f44153f90418dc013f064e82e3f80f38bee63452ab7612e669651365c90b9
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/sim/lib/api/contracts/v2/files.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-615f44153f90418dc013f064e82e3f80f38bee63452ab7612e669651365c90b9
https://github.com/simstudioai/sim/pull/8588/files#diff-615f44153f90418dc013f064e82e3f80f38bee63452ab7612e669651365c90b9
apps/sim/lib/internal/file/operations.test.tshttps://github.com/simstudioai/sim/pull/8588/files#diff-5b618a3954aee1f8dad948808cf9107f1f42b6a08bcc904adb65d83c19cce192
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/sim/lib/internal/file/operations.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-5b618a3954aee1f8dad948808cf9107f1f42b6a08bcc904adb65d83c19cce192
https://github.com/simstudioai/sim/pull/8588/files#diff-5b618a3954aee1f8dad948808cf9107f1f42b6a08bcc904adb65d83c19cce192
apps/sim/lib/mothership/agent-cli/engines/file-read.test.tshttps://github.com/simstudioai/sim/pull/8588/files#diff-cd25374b25d55ddbf435f37752ac4d11821e18cd801d750c5ad43f13b9bb049d
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/sim/lib/mothership/agent-cli/engines/file-read.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-cd25374b25d55ddbf435f37752ac4d11821e18cd801d750c5ad43f13b9bb049d
Please reload this pagehttps://github.com/simstudioai/sim/pull/8588/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8588/files
https://github.com/simstudioai/sim/pull/8588/files#diff-cd25374b25d55ddbf435f37752ac4d11821e18cd801d750c5ad43f13b9bb049d
apps/sim/lib/workspace-files/text-lines.test.tshttps://github.com/simstudioai/sim/pull/8588/files#diff-e31ff9bf57fcaac084d6f051106e6c2495fe34a9a666daa552cd3e90044110a0
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/apps/sim/lib/workspace-files/text-lines.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-e31ff9bf57fcaac084d6f051106e6c2495fe34a9a666daa552cd3e90044110a0
https://github.com/simstudioai/sim/pull/8588/files#diff-e31ff9bf57fcaac084d6f051106e6c2495fe34a9a666daa552cd3e90044110a0
packages/sim-cli/src/generated/v2-api.tshttps://github.com/simstudioai/sim/pull/8588/files#diff-e856e756b18965607efb943e85bad153871936ce3ee5180ec2e8073a28dd1dd7
View file https://github.com/simstudioai/sim/blob/ef6bb7b8d1bdc4c69e0bafe5c399eb9c469247d6/packages/sim-cli/src/generated/v2-api.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8588/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8588/files#diff-e856e756b18965607efb943e85bad153871936ce3ee5180ec2e8073a28dd1dd7
https://github.com/simstudioai/sim/pull/8588/files#diff-e856e756b18965607efb943e85bad153871936ce3ee5180ec2e8073a28dd1dd7
https://github.com/simstudioai/sim/pull/8588/files#diff-e856e756b18965607efb943e85bad153871936ce3ee5180ec2e8073a28dd1dd7
Please reload this pagehttps://github.com/simstudioai/sim/pull/8588/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.