Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
5c52981
feat: spawn docker container and use docker as sandbox
khoangothe May 21, 2025
1a20a74
feat: proxy container
khoangothe May 22, 2025
71d4a04
feat: subdomain support
khoangothe May 24, 2025
b68c81d
feat: dockerize
khoangothe May 27, 2025
9b6d6cf
feat: clean up docker file
khoangothe May 27, 2025
e3dc2d1
feat: clean up docker file
khoangothe May 27, 2025
966866d
Merge remote-tracking branch 'origin' into feat/docker-sandbox
khoangothe May 27, 2025
2e863c4
feat: build frontend with start script
khoangothe May 27, 2025
e1eecef
chore: clean up
khoangothe May 27, 2025
3cfced3
feat: add stop script
khoangothe May 27, 2025
c22792e
feat: reverse compatibility with normal deploymode
khoangothe May 28, 2025
af07466
chore: smoothen installation flow
khoangothe May 28, 2025
388d6f6
chore: update unnecessary rebuild
khoangothe May 28, 2025
6ea3f73
fix: add project name to docker spawn dynamically
khoangothe May 28, 2025
40cce81
feat: reverse compatibility with normal deploymode
khoangothe May 29, 2025
5055ea6
chore: update readme and installation guide
khoangothe May 29, 2025
f2b33ee
chore: update readme and installation guide
khoangothe May 29, 2025
7dd7b20
cache: multi session terminal
khoangothe Jun 3, 2025
89fbc53
feat: terminal shell session
khoangothe Jun 3, 2025
5fad48e
Merge branch 'main' into feat/docker-sandbox
khoangothe Jun 3, 2025
ecb9192
feat: terminal shell session
khoangothe Jun 3, 2025
962b948
feat: bug fix
khoangothe Jun 3, 2025
98dbb50
fix: build fail
khoangothe Jun 3, 2025
8006cbf
fix: performance bug and slidedeck tool
khoangothe Jun 4, 2025
5bac660
fix: relative path
khoangothe Jun 4, 2025
100c663
frontend: write tool
khoangothe Jun 4, 2025
9ea75ec
fix: relative path
khoangothe Jun 4, 2025
66df6f8
fix: relative path
khoangothe Jun 4, 2025
f6281db
feat: docker sandbox server
khoangothe Jun 10, 2025
0962185
feat: docker sandbox server
khoangothe Jun 10, 2025
5a22829
feat: docker sandbox e2b
khoangothe Jun 11, 2025
4a410a5
Merge branch 'main' into feat/docker-server-sandbox
khoangothe Jun 11, 2025
1cb42f6
feat: docker sandbox e2b
khoangothe Jun 11, 2025
ece07bb
feat: docker sandbox e2b
khoangothe Jun 11, 2025
e0d577c
Merge branch 'main' into feat/docker-server-sandbox
khoangothe Jun 11, 2025
87dbc41
fix: relative file support for local
khoangothe Jun 12, 2025
89d10ec
fix: bump e2b timeout
khoangothe Jun 12, 2025
90dac94
fix: missing params
khoangothe Jun 12, 2025
1258c95
Merge branch 'main' into feat/docker-server-sandbox
khoangothe Jun 13, 2025
c7088eb
feat: resolve conflict and refactor
khoangothe Jun 13, 2025
805f2f7
feat: flexible nginx port
khoangothe Jun 13, 2025
f3c6d02
clean up: clean up commit
khoangothe Jun 14, 2025
f0bdff6
feat: next/react template
khoangothe Jun 15, 2025
2a24721
fix: sandbox image name dynamic
khoangothe Jun 15, 2025
6705d25
fix: sandbox image name dynamic
khoangothe Jun 15, 2025
633f0bd
fix: sandbox image name dynamic
khoangothe Jun 15, 2025
f5ea130
fix: sandbox image name dynamic
khoangothe Jun 15, 2025
39f5c0c
fix: update node option
khoangothe Jun 15, 2025
0d1d682
feat(frontend): handle shell tool
baquy96 Jun 16, 2025
dde94b8
fix: build failed
baquy96 Jun 16, 2025
ee5faa3
fix: update node option
khoangothe Jun 16, 2025
cd55eda
fix: update node option
khoangothe Jun 16, 2025
dc394f2
fix: update deploy rule
khoangothe Jun 17, 2025
3d5281e
fix: websocket connection
khoangothe Jun 18, 2025
62f66e0
chore: clean up
khoangothe Jun 18, 2025
ec0b99c
Merge branch 'main' into feat/web-template
khoangothe Jun 18, 2025
d05b54f
fix: fe build
khoangothe Jun 18, 2025
575d36d
fix: conflict
khoangothe Jun 18, 2025
30c20fa
fix: conflict
khoangothe Jun 18, 2025
33ca0cb
fix: agent response
khoangothe Jun 18, 2025
0de931e
fix: response type
khoangothe Jun 19, 2025
190a5f0
Merge branch 'main' into feat/web-template
khoangothe Jun 19, 2025
9880118
fix: tool order
khoangothe Jun 19, 2025
3771321
feat: use nginx as proxy
khoangothe Jun 20, 2025
5c17050
feat: use nginx as proxy fix
khoangothe Jun 20, 2025
b329b58
feat: tmux session manager
khoangothe Jun 21, 2025
f34f346
feat: tmux session manager
khoangothe Jun 21, 2025
cf73652
feat: tmux truncation
khoangothe Jun 21, 2025
df2d61f
feat: better tmux
khoangothe Jun 22, 2025
ae9c276
feat: fix minor bug
khoangothe Jun 22, 2025
cb81ff7
feat: advance connection tool
khoangothe Jun 23, 2025
5986351
fix: missing input
khoangothe Jun 23, 2025
bd075bc
fix: change system prompt
khoangothe Jun 23, 2025
5ea6bf8
fix: package.json template
khoangothe Jun 23, 2025
5afae5f
template: update template
khoangothe Jun 23, 2025
a4ac28a
template: update template
khoangothe Jun 23, 2025
935def2
template: fix watch
khoangothe Jun 23, 2025
e9e2fb7
fix: ignore node_modules, build, dist folder
khongtrunght Jun 23, 2025
9254ba1
template: fix pdf-parse
khoangothe Jun 23, 2025
eeb1814
template: fix watch
khoangothe Jun 23, 2025
1ec3252
template: fix watch
khoangothe Jun 23, 2025
8907f70
fullstack web application with react and python
ducphuE10 Jun 24, 2025
cf5cb20
feat: update template and system prompt
khoangothe Jun 25, 2025
06c220f
feat: update template and system prompt
khoangothe Jun 25, 2025
5d4737f
feat: update template and system prompt
khoangothe Jun 25, 2025
131bfa8
feat: update template and system prompt
khoangothe Jun 25, 2025
ce3e6e3
feat: update template and system prompt
khoangothe Jun 25, 2025
3580aa3
feat: update template and system prompt
khoangothe Jun 25, 2025
731d95f
feat: update template and system prompt
khoangothe Jun 25, 2025
0612bec
feat: update template and system prompt
khoangothe Jun 25, 2025
0126fbc
feat: update template and system prompt
khoangothe Jun 25, 2025
857e3e5
feat: update template and system prompt
khoangothe Jun 25, 2025
ca87cb5
fix: relative exec dir
khoangothe Jun 25, 2025
3c7e68d
simplify system prompt
ducphuE10 Jun 27, 2025
1c86323
Merge branch 'feat/fullstack-web-react-python' of https://github.com/…
ducphuE10 Jun 27, 2025
9e0c669
feat: vercel deployment tool
khoangothe Jun 27, 2025
eb0f92c
fix: deployment fix
khoangothe Jun 27, 2025
086a029
chore: refactor to prepare merge
khoangothe Jun 29, 2025
40709a3
feat: merge fastapi branch
khoangothe Jun 29, 2025
a1aa2b3
chore: clean up legacy
khoangothe Jun 29, 2025
a76baea
fix: deployment fix
khoangothe Jun 29, 2025
796b22c
Merge branch 'main' into feat/merge-web-dev
khoangothe Jun 30, 2025
d3c6dc6
chore: clean up and fixbug
khoangothe Jun 30, 2025
bf12600
chore: refactor and fix bug
khoangothe Jun 30, 2025
36cfefc
chore: refactor and fix bug
khoangothe Jun 30, 2025
f1a1676
chore: merge to main
khoangothe Jul 1, 2025
3d81d64
chore: update config
khoangothe Jul 1, 2025
c94f8d2
fix: continue chatting
khoangothe Jul 1, 2025
9958077
fix: vercel integration
khoangothe Jul 1, 2025
abd020a
fix: quick fix upload
khoangothe Jul 1, 2025
b01b051
fix: blocking calls
khoangothe Jul 1, 2025
856c22c
add /compact logic
PhungVanDuy Jul 3, 2025
4378cc6
add summarize for /compact
PhungVanDuy Jul 3, 2025
fdf6d11
fix: circular import, thinking block and local deployment
khoangothe Jul 3, 2025
06ea25c
feat: add code-server
baquy96 Jun 29, 2025
4dc7551
feat: easier set up
khoangothe Jul 4, 2025
6a54615
Merge branch 'main' into feat/merge-web-dev
khoangothe Jul 4, 2025
1fffa89
chore: update gitignore
khoangothe Jul 4, 2025
8420eec
fix: revert quickfix and thinking block
khoangothe Jul 4, 2025
3fe9028
fix: e2b start
khoangothe Jul 4, 2025
c13bc40
feat(setting-dialog): sandbox and third party
baquy96 Jul 4, 2025
ab3c814
fix: e2b start
khoangothe Jul 7, 2025
b55bd4f
feat: e2b integration
khoangothe Jul 7, 2025
4fad781
fix: minor bug
khoangothe Jul 7, 2025
39054bf
feat(setting-dialog): sandbox and third party (#124)
baquy96 Jul 8, 2025
8b7aa02
feat: flexible import
khoangothe Jul 8, 2025
8d57143
fix: update credential fix
khoangothe Jul 8, 2025
54a3de4
Update README.md
khoangothe Jul 8, 2025
523c8b1
Update README.md
PhungVanDuy Jul 8, 2025
e1cb3e4
refactor(messages): improve performance
baquy96 Jul 8, 2025
29e2311
resolve conflict
PhungVanDuy Jul 8, 2025
209d537
get start
PhungVanDuy Jul 8, 2025
24fa739
add new filesystem / todo tools - minor fix openai llm
PhungVanDuy Jul 12, 2025
617d960
Merge branch 'main' into feat/add-grok-4
khoangothe Jul 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ You can view the full traces of some samples here: [GAIA Benchmark Traces](https
1. Clone the repository
2. Run the following command

<img width="821" alt="Screenshot 2025-07-08 at 17 50 34" src="https://github.com/user-attachments/assets/094f73aa-7384-4500-a670-528853f92ae7" />


```
chmod +x start.sh
./start.sh
Expand Down
3 changes: 3 additions & 0 deletions docker/sandbox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ RUN apt-get update && apt-get install -y \
unzip

COPY src/ii_agent/utils/tool_client /app/ii_client
COPY ./ /app/

WORKDIR /app

RUN pip install -r ii_client/requirements.txt

RUN pip install .

RUN curl -fsSL https://bun.sh/install | bash
RUN curl -fsSL https://code-server.dev/install.sh | sh

Expand Down
2 changes: 1 addition & 1 deletion frontend/constants/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ export const PROVIDER_MODELS: { [key: string]: IModel[] } = {
provider: "openai",
},
],
};
};
2 changes: 1 addition & 1 deletion src/ii_agent/agents/function_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FunctionCallAgent(BaseAgent):
A general agent that can accomplish tasks and answer questions.

If you are faced with a task that involves more than a few steps, or if the task is complex, or if the instructions are very long,
try breaking down the task into smaller steps. After call this tool to update or create a plan, use write_file or str_replace_tool to update the plan to todo.md
try breaking down the task into smaller steps. After call this tool to update or create a plan, use Write or Edit tools to update the plan to todo.md
"""
input_schema = {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion src/ii_agent/core/config/llm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LLMConfig(BaseModel):
model: str = Field(default=DEFAULT_MODEL)
api_key: SecretStr | None = Field(default=None)
base_url: str | None = Field(default=None)
max_retries: int = Field(default=3)
max_retries: int = Field(default=5)
max_message_chars: int = Field(default=30_000)
temperature: float = Field(default=0.0)
vertex_region: str | None = Field(default=None)
Expand Down
4 changes: 1 addition & 3 deletions src/ii_agent/llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
def get_client(config: LLMConfig) -> LLMClient:
"""Get a client for a given client name."""
if config.api_type == APITypes.ANTHROPIC:
return AnthropicDirectClient(
llm_config=config,
)
return AnthropicDirectClient(llm_config=config)
elif config.api_type == APITypes.OPENAI:
return OpenAIDirectClient(llm_config=config)
elif config.api_type == APITypes.GEMINI:
Expand Down
14 changes: 11 additions & 3 deletions src/ii_agent/llm/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def generate(
config=types.GenerateContentConfig(
tools=tool_params,
system_instruction=system_prompt,
temperature=temperature,
max_output_tokens=max_tokens,
tool_config={'function_calling_config': {'mode': mode}}
),
Expand All @@ -150,8 +149,17 @@ def generate(
raise e

internal_messages = []
if response.text:
internal_messages.append(TextResult(text=response.text))
text_parts = []
if response.candidates and len(response.candidates) > 0:
candidate = response.candidates[0]
if candidate.content and candidate.content.parts:
for part in candidate.content.parts:
if hasattr(part, 'text') and part.text:
text_parts.append(part.text)

if text_parts:
combined_text = ''.join(text_parts)
internal_messages.append(TextResult(text=combined_text))

if response.function_calls:
for fn_call in response.function_calls:
Expand Down
31 changes: 16 additions & 15 deletions src/ii_agent/llm/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ def generate(
role = "user"
elif str(type(internal_message)) == str(TextResult):
internal_message = cast(TextResult, internal_message)
# For TextResult (assistant), content is handled differently by OpenAI API
message_content_obj = {"type": "text", "text": internal_message.text}
openai_message = {"role": "assistant", "content": [message_content_obj]}
# For TextResult (assistant), OpenAI expects content as a string for regular messages
openai_message = {"role": "assistant", "content": internal_message.text}
openai_messages.append(openai_message)
continue # Move to next message in outer loop
elif str(type(internal_message)) == str(ToolCall):
Expand Down Expand Up @@ -163,8 +162,8 @@ def generate(
final_text_for_user_message = f"{system_prompt}\n\n{current_message_text}"
system_prompt_applied = True # Mark as applied

message_content_obj = {"type": "text", "text": final_text_for_user_message}
openai_message = {"role": role, "content": [message_content_obj]}
# For regular text messages, OpenAI expects content as a string
openai_message = {"role": role, "content": final_text_for_user_message}
openai_messages.append(openai_message)

# If cot_model is True and system_prompt was provided but not applied (e.g., no user messages found, though unlikely for an agent)
Expand All @@ -173,7 +172,7 @@ def generate(
# Or, one might argue it's an error condition for COT if no user prompt exists.
# For now, let's log a warning and add it as a user message, as some COT models might expect user turn for instructions.
logger.warning("COT mode: System prompt provided but no initial user message to prepend to. Adding as a separate user message.")
openai_messages.insert(0, {"role": "user", "content": [{"type": "text", "text": system_prompt}]})
openai_messages.insert(0, {"role": "user", "content": system_prompt})

# Turn tool_choice into OpenAI tool_choice format
if tool_choice is None:
Expand Down Expand Up @@ -234,8 +233,7 @@ def generate(
raise e
else:
print(f"Retrying OpenAI request: {retry + 1}/{self.max_retries}")
# Sleep 8-12 seconds with jitter to avoid thundering herd.
time.sleep(10 * random.uniform(0.8, 1.2))
time.sleep(30)

# Convert messages back to internal format
internal_messages = []
Expand All @@ -248,10 +246,10 @@ def generate(
content = openai_response_message.content

# Exactly one of tool_calls or content should be present
if tool_calls and content:
raise ValueError("Only one of tool_calls or content should be present")
elif not tool_calls and not content:
raise ValueError("Either tool_calls or content should be present")
#if tool_calls and content:
# raise ValueError("Only one of tool_calls or content should be present")
#elif not tool_calls and not content:
# raise ValueError("Either tool_calls or content should be present")

if tool_calls:
available_tool_names = {t.name for t in tools} # Get set of known tool names
Expand Down Expand Up @@ -297,10 +295,13 @@ def generate(
if not processed_tool_call:
logger.warning("No valid and available tool calls found after filtering.")

elif content:
internal_messages.append(TextResult(text=content))
elif content is not None:
# Handle empty content (including empty strings) from models that may return reasoning without content
internal_messages.append(TextResult(text=content if content else ""))
else:
raise ValueError(f"Unknown message type: {openai_response_message}")
# Only raise error if we truly have no content and no tool calls
logger.warning(f"Response has no content or tool_calls: {openai_response_message}")
internal_messages.append(TextResult(text=""))

assert response.usage is not None
message_metadata = {
Expand Down
3 changes: 2 additions & 1 deletion src/ii_agent/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ def run_migrations_online() -> None:
if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()
pass
#run_migrations_online()
11 changes: 4 additions & 7 deletions src/ii_agent/prompts/system_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,9 @@ def get_system_prompt(workspace_mode: WorkSpaceMode):
</planner_module>

<todo_rules>
- Create todo.md file as checklist based on task planning from planner module
- Task planning takes precedence over todo.md, while todo.md contains more details
- Update markers in todo.md via text replacement tool immediately after completing each item
- Rebuild todo.md when task planning changes significantly
- Must use todo.md to record and update progress for information gathering tasks
- When all planned steps are complete, verify todo.md completion and remove skipped items
- Use TodoRead and TodoWrite tools to manage your todo list
- Frequently update the todo list to track the progress
- When all planned steps are complete, verify todo list completion and remove skipped items
</todo_rules>

<message_rules>
Expand Down Expand Up @@ -351,7 +348,7 @@ def get_system_prompt(workspace_mode: WorkSpaceMode):
- Events may originate from other system modules; only use explicitly provided tools
</tool_use_rules>

Today is {datetime.now().strftime("%Y-%m-%d")}. The first step of a task is to use `message_user` tool to plan details of the task. Then regularly update the todo.md file to track the progress.
Today is {datetime.now().strftime("%Y-%m-%d")}. The first step of a task is to use `message_user` tool to plan details of the task. Then regularly update the todo list to track the progress.
"""


Expand Down
Loading